
0800              2           DCM "WRITE CDI.LIST"

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


0800              3           TTL "DOS 3.3 CMD INTERPRETER"
9D00              4           ORG $9D00
9D00              5           OBJ $800
9D00              6  ;
9D00              7  ;
0024              8  CH       EPZ $24
0028              9  BASE     EPZ $28
0036             10  CSW      EPZ $36
0033             11  PROMPT   EPZ $33
0038             12  KSW      EPZ $38
0044             13  OPRND    EPZ $44
0040             14  FILEBUF  EPZ $40
004C             15  INTHIMEM EPZ $4C
004A             16  INTLOMEM EPZ $4A
0067             17  ASPGMST  EPZ $67
006F             18  ASSTRS   EPZ $6F
0069             19  ASVARS   EPZ $69
0076             20  ASRUN    EPZ $76
0073             21  ASHIMEM  EPZ $73
00AF             22  ASPEND   EPZ $AF
00CC             23  INTVEND  EPZ $CC
00CA             24  INTSTRT  EPZ $CA
00D6             25  PROTECT  EPZ $D6
00D8             26  ASONERR  EPZ $D8
00D9             27  INTRUN   EPZ $D9
0200             28  IN       EQU $200
03D0             29  DOSRST   EQU $3D0
03F4             30  PWREDUP  EQU $3F4
03F2             31  SOFTEV   EQU $3F2
9D00             32  ;
9D00             33  ; RAM A/S ENTRY PTS
9D00             34  ;
0C3C             35  LC3C     EQU $C3C
0CF2             36  LCF2     EQU $CF2
0E65             37  LE65     EQU $E65
0FD4             38  LFD4     EQU $FD4
1067             39  L1067    EQU $1067
9D00             40  ;
9D00             41  ;
9D00             42  ;
9D00             43  ;
9D00             44  ;
9CD4             45  DBUF     EQU $9CD4
AAFD             46  FMGR2    EQU $AAFD
AB06             47  FMGR     EQU $AB06
9D00             48  ;
9D00             49  ; FILE MANAGER EQUATES
9D00             50  ;
B5A9             51  LB5A9    EQU $B5A9
B5BF             52  VOLUME   EQU $B5BF
B5BD             53  RECNUM   EQU $B5BD
B5BD             54  NEWNAME  EQU RECNUM
B5BC             55  FMSUBOP  EQU $B5BC
B5BB             56  FMP      EQU $B5BB
B5BB             57  FMOP     EQU $B5BB
B5C5             58  RTNCODE  EQU $B5C5
B5C3             59  FNADR    EQU $B5C3
B5C3             60  DATARANG EQU $B5C3
B5C2             61  FILETYPE EQU $B5C2
B5C1             62  SLOT     EQU $B5C1
B5C1             63  RANGELEN EQU $B5C1

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


B5C0             64  DRIVE    EQU $B5C0
9D00             65  ;
9D00             66  ; DOS PATCHES
9D00             67  ;
B65E             68  APNDPTCH EQU $B65E
B671             69  APTCH2   EQU $B671
B686             70  VFYPTCH  EQU $B686
B692             71  APTCH3   EQU $B692
B7B5             72  CALLRWTS EQU $B7B5
B7EA             73  IOBDRV   EQU $B7EA
B7E9             74  IOBSLOT  EQU $B7E9
BFDC             75  AJUSTBYT EQU $BFDC
BFE6             76  SETWARM  EQU $BFE6
C081             77  ROM      EQU $C081
C080             78  RAM      EQU $C080
9D00             79  ;
9D00             80  ;
9D00             81  ;
9D00             82  ; APPLESOFT EQUATES
9D00             83  ;
D43C             84  LD43C    EQU $D43C
D4F2             85  LD4F2    EQU $D4F2
D665             86  LD665    EQU $D665
D7D2             87  LD7D2    EQU $D7D2
D865             88  LD865    EQU $D865
9D00             89  ;
9D00             90  ;
9D00             91  ; INTEGER EQUATES
9D00             92  ;
E003             93  BASWRM   EQU $E003
E000             94  BASCLD   EQU $E000
E3E3             95  INTERR   EQU $E3E3
E836             96  IRUN     EQU $E836
9D00             97  ;
9D00             98  ; MONITOR EQUATES
9D00             99  ;
FA59            100  OLDBRK   EQU $FA59
FE8B            101  INPRT    EQU $FE8B
FE95            102  OUTPRT   EQU $FE95
FF58            103  RTS      EQU $FF58
FF65            104  MON      EQU $FF65
9D00            105  ;
9D00            106  ;
9D00            107  ;
9D00            108  ;
9D00 D3 9C      109  DBUFP    ADR DBUF-1
9D02 81 9E      110  DOSKBD   ADR KBDINTRC
9D04 BD 9E      111  DOSVID   ADR VIDINTRC
9D06 75 AA      112  PFNADR   ADR FNAME
9D08 93 AA      113  SFNADR   ADR SFNAME
9D0A 60 AA      114  LDRNGLEN ADR LOADLEN
9D0C 00 9D      115  LOADADR  ADR $9D00
9D0E BB B5      116  FMPARMS  ADR FMOP
9D10            117  ;
9D10            118  ;
9D10            119  ; CSW STATE HANDLER ADDRESSES
9D10            120  ;
9D10 EA 9E      121  CSWSTADR ADR CSWST0-1

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


9D12 11 9F      122           ADR CSWST1-1
9D14 22 9F      123           ADR CSWST2-1
9D16 2E 9F      124           ADR CSWST3-1
9D18 51 9F      125           ADR CSWST4-1
9D1A 60 9F      126           ADR CSWST5-1
9D1C 70 9F      127           ADR CSWST6-1
9D1E            128  ;
9D1E            129  ;
9D1E            130  ;COMMAND ADDRESSES
9D1E            131  ;
9D1E 4E A5      132  CMDTBL   ADR DOINIT-1
9D20 12 A4      133           ADR DOLOAD-1
9D22 96 A3      134           ADR DOSAVE-1
9D24 D0 A4      135           ADR DORUN-1
9D26 EF A4      136           ADR DOCHAIN-1
9D28 62 A2      137           ADR DODELETE-1
9D2A 70 A2      138           ADR DOLOCK-1
9D2C 74 A2      139           ADR DOUNLOCK-1
9D2E E9 A2      140           ADR DOCLOSE-1
9D30 1A A5      141           ADR DOREAD-1
9D32 C5 A5      142           ADR DOEXEC-1
9D34 0F A5      143           ADR DOWRITE-1
9D36 DC A5      144           ADR DOPSTION-1
9D38 A2 A2      145           ADR DOOPEN-1
9D3A 97 A2      146           ADR DOAPND-1
9D3C 80 A2      147           ADR DORENAME-1
9D3E 6D A5      148           ADR DOCAT-1
9D40 32 A2      149           ADR DOMON-1
9D42 3C A2      150           ADR DONOMON-1
9D44 28 A2      151           ADR DOPRNUM-1
9D46 2D A2      152           ADR DOINNUM-1
9D48 50 A2      153           ADR DOMXFLS-1
9D4A 79 A5      154           ADR DOFP-1
9D4C 9D A5      155           ADR DOINT-1
9D4E 30 A3      156           ADR DOBSAVE-1
9D50 5C A3      157           ADR DOBLOAD-1
9D52 8D A3      158           ADR DOBRUN-1
9D54 7C A2      159           ADR DOVERIFY-1
9D56            160  ;
9D56            161  ;
9D56            162  ; ACTIVE BASIC TABLE
9D56            163  ;
9D56 36 E8      164  CHNADR   ADR IRUN
9D58 E5 A4      165  RUNADR   ADR DOSIRUN
9D5A E3 E3      166  BASERR   ADR INTERR
9D5C 00 E0      167  BASCOLD  ADR BASCLD
9D5E 03 E0      168  BASWARM  ADR BASWRM
9D60 F2 D4      169  ASFTREL  ADR LD4F2
9D62            170  ;
9D62            171  ; INTEGER STUFF
9D62            172  ;
9D62 36 E8      173  INTTBL   ADR IRUN
9D64 E5 A4      174           ADR DOSIRUN
9D66 E3 E3      175           ADR INTERR
9D68 00 E0      176           ADR BASCLD
9D6A 03 E0      177           ADR BASWRM
9D6C            178  ;
9D6C            179  ; ROM APPLESOFT STUFF

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


9D6C            180  ;
9D6C FC A4      181  FPTBL    ADR DOSARUN
9D6E FC A4      182           ADR DOSARUN
9D70 65 D8      183           ADR LD865
9D72 00 E0      184           ADR BASCLD
9D74 3C D4      185           ADR LD43C
9D76 F2 D4      186           ADR LD4F2
9D78            187  ;
9D78            188  ; RAM APPLESOFT STUFF
9D78            189  ;
9D78 06 A5      190  RAMASTBL ADR DOSA2RUN
9D7A 06 A5      191           ADR DOSA2RUN
9D7C 67 10      192           ADR L1067
9D7E 84 9D      193           ADR DOSSTRT
9D80 3C 0C      194           ADR LC3C
9D82 F2 0C      195           ADR LCF2
9D84            196  ;
9D84            197  ;
9D84            198  ;
9D84            199  ;
9D84            200  ; DOS COLDSTART ADDRESS
9D84            201  ;
9D84            202  ;
9D84            203  ;
9D84            204  ; INIT DEFAULT SLOT & DRIVE
9D84            205  ;
9D84 AD E9 B7   206  DOSSTRT  LDA IOBSLOT
9D87 4A         207           LSR 
9D88 4A         208           LSR 
9D89 4A         209           LSR 
9D8A 4A         210           LSR 
9D8B 8D 6A AA   211           STA SLOTVAL
9D8E AD EA B7   212           LDA IOBDRV
9D91 8D 68 AA   213           STA DRVAL
9D94            214  ;
9D94            215  ;
9D94            216  ; See which BASIC is active
9D94            217  ;
9D94 AD 00 E0   218           LDA BASCLD
9D97 49 20      219           EOR #$20
9D99 D0 11      220           BNE LDFPBAS
9D9B            221  ;
9D9B            222  ;
9D9B            223  ; Integer BASIC is active,
9D9B            224  ; move all required addresses
9D9B            225  ; down there.
9D9B            226  ;
9D9B 8D B6 AA   227           STA WHCBASIC
9D9E A2 0A      228           LDX #$A
9DA0 BD 61 9D   229  LDINT    LDA INTTBL-1,X
9DA3 9D 55 9D   230           STA CHNADR-1,X
9DA6 CA         231           DEX 
9DA7 D0 F7      232           BNE LDINT
9DA9 4C BC 9D   233           JMP CHSBASIC
9DAC            234  ;
9DAC            235  ;
9DAC            236  ; Applesoft BASIC is active,
9DAC            237  ; move A/S addresses to the

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


9DAC            238  ; active BASIC addresses area.
9DAC            239  ;
9DAC A9 40      240  LDFPBAS  LDA #$40
9DAE 8D B6 AA   241           STA WHCBASIC
9DB1 A2 0C      242           LDX #$C
9DB3 BD 6B 9D   243  LDFPTBL  LDA FPTBL-1,X
9DB6 9D 55 9D   244           STA CHNADR-1,X
9DB9 CA         245           DEX 
9DBA D0 F7      246           BNE LDFPTBL
9DBC 38         247  CHSBASIC SEC 
9DBD B0 12      248           BCS INITDOS
9DBF            249  ;
9DBF            250  ;
9DBF            251  ; DOS Warmstart
9DBF            252  ;
9DBF AD B6 AA   253  DOSWARM  LDA WHCBASIC
9DC2 D0 04      254           BNE >1
9DC4            255  ;
9DC4            256  ; Cause integer BASIC to be
9DC4            257  ; selected.
9DC4            258  ;
9DC4 A9 20      259           LDA #$20
9DC6 D0 05      260           BNE >2
9DC8 0A         261  ^1       ASL 
9DC9 10 05      262           BPL >3
9DCB            263  ;
9DCB            264  ;
9DCB            265  ; Select Applesoft BASIC.
9DCB            266  ;
9DCB A9 4C      267           LDA #$4C
9DCD 20 B2 A5   268  ^2       JSR SETBASIC
9DD0 18         269  ^3       CLC 
9DD1            270  ;
9DD1            271  ;
9DD1            272  ;
9DD1            273  ; Initialize DOS.
9DD1            274  ;
9DD1 08         275  INITDOS  PHP 
9DD2 20 51 A8   276           JSR INITPTRS
9DD5 A9 00      277           LDA #$0             ;set NOMON O,I,C
9DD7 8D 5E AA   278           STA MONFLGS
9DDA 8D 52 AA   279           STA CSWSTATE        ;init to state 0
9DDD 28         280           PLP 
9DDE 6A         281           ROR 
9DDF 8D 51 AA   282           STA CURSTAT
9DE2 30 03      283           BMI >1
9DE4 6C 5E 9D   284           JMP (BASWARM)
9DE7 6C 5C 9D   285  ^1       JMP (BASCOLD)
9DEA            286  ;
9DEA            287  ;
9DEA            288  ;
9DEA            289  ; FRSTIME is call after a DOS coldstart
9DEA            290  ; it checks for RAM A/S and takes
9DEA            291  ; care of other coldstart stuff
9DEA            292  ; that must be done after BASIC
9DEA            293  ; is initialized.
9DEA            294  ;
9DEA 0A         295  FRSTIME  ASL                 ;check for RAM or ROM A/S

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


9DEB 10 19      296           BPL >2
9DED            297  ;
9DED            298  ;
9DED            299  ; If RAM A/S, move required pointers
9DED            300  ; into the active BASIC area.
9DED            301  ;
9DED 8D B6 AA   302           STA WHCBASIC
9DF0 A2 0C      303           LDX #$C
9DF2 BD 77 9D   304  MOVRAMAS LDA RAMASTBL-1,X
9DF5 9D 55 9D   305           STA CHNADR-1,X
9DF8 CA         306           DEX 
9DF9 D0 F7      307           BNE MOVRAMAS
9DFB A2 1D      308           LDX #$1D
9DFD BD 93 AA   309  ^1       LDA SFNAME,X
9E00 9D 75 AA   310           STA FNAME,X
9E03 CA         311           DEX 
9E04 10 F7      312           BPL <1
9E06            313  ;
9E06            314  ;
9E06            315  ; Init MAXFILES to the default
9E06            316  ; value (usually 3)
9E06            317  ;
9E06 AD B1 AA   318  ^2       LDA MXFLS
9E09 8D 57 AA   319           STA MAXFILES
9E0C            320  ;
9E0C            321  ; set up the DOS buffers chain
9E0C            322  ;
9E0C 20 D4 A7   323           JSR INITBUFS
9E0F            324  ;
9E0F            325  ;
9E0F            326  ; if EXEC is active, cause it to
9E0F            327  ; become inactive on the next
9E0F            328  ; character input
9E0F            329  ;
9E0F AD B3 AA   330           LDA EXFLG
9E12 F0 09      331           BEQ >3
9E14 48         332           PHA 
9E15 20 9D A6   333           JSR PNTEXEC
9E18 68         334           PLA 
9E19 A0 00      335           LDY #0
9E1B 91 40      336           STA (FILEBUF),Y
9E1D            337  ;
9E1D            338  ;
9E1D            339  ; reset the CSW state to 0, set
9E1D            340  ; warmstart status.
9E1D            341  ;
9E1D 20 5B A7   342  ^3       JSR RSET0
9E20            343  ;
9E20            344  ;
9E20            345  ; check to see if we are in the
9E20            346  ; middle of a command.
9E20            347  ;
9E20 AD 5F AA   348           LDA CMDINDX
9E23 D0 20      349           BNE TSTPEND
9E25            350  ;
9E25            351  ;
9E25            352  ; If not, copy the page 3 stuff
9E25            353  ; down to $3D0

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


9E25            354  ;
9E25 A2 2F      355           LDX #$2F
9E27 BD 51 9E   356  MOV3D0   LDA PAG3,X
9E2A 9D D0 03   357           STA DOSRST,X
9E2D CA         358           DEX 
9E2E 10 F7      359           BPL MOV3D0
9E30 AD 53 9E   360           LDA PAG3+2
9E33 8D F3 03   361           STA SOFTEV+1
9E36 49 A5      362           EOR #$A5
9E38 8D F4 03   363           STA PWREDUP
9E3B AD 52 9E   364           LDA PAG3+1
9E3E 8D F2 03   365           STA SOFTEV
9E41 A9 06      366           LDA #$6
9E43 D0 05      367           BNE >1
9E45            368  ;
9E45            369  ;
9E45            370  ; If there is a command pending
9E45            371  ; (because RAM A/S was loaded?)
9E45            372  ; then execute it, otherwise
9E45            373  ; return to BASIC.
9E45            374  ;
9E45 AD 62 AA   375  TSTPEND  LDA PENDCMD
9E48 F0 06      376           BEQ >2
9E4A 8D 5F AA   377  ^1       STA CMDINDX
9E4D 4C 80 A1   378           JMP DOCMD
9E50 60         379  ^2       RTS 
9E51            380  ;
9E51            381  ;
9E51            382  ; Stuff that gets moved down to
9E51            383  ; $3D0
9E51            384  ;
9E51 4C BF 9D   385  PAG3     JMP DOSWARM
9E54 4C 84 9D   386           JMP DOSSTRT
9E57 4C FD AA   387           JMP FMGR2
9E5A 4C B5 B7   388           JMP CALLRWTS
9E5D AD 0F 9D   389           LDA FMPARMS+1
9E60 AC 0E 9D   390           LDY FMPARMS
9E63 60         391           RTS 
9E64 AD C2 AA   392           LDA LAAC1+1
9E67 AC C1 AA   393           LDY LAAC1
9E6A 60         394           RTS 
9E6B 4C 51 A8   395           JMP INITPTRS
9E6E EA         396           NOP 
9E6F EA         397           NOP 
9E70 4C 59 FA   398           JMP OLDBRK
9E73 4C 65 FF   399           JMP MON
9E76 4C 58 FF   400           JMP RTS
9E79 4C 65 FF   401           JMP MON
9E7C 4C 65 FF   402           JMP MON
9E7F 65 FF      403           ADR $FF65
9E81            404  ;
9E81            405  ;
9E81            406  ; Keyboard intercept routine.
9E81            407  ; Called each time a character
9E81            408  ; is requested.
9E81            409  ; "HOOKS" at $38 and $39 point
9E81            410  ; at this routine.
9E81            411  ;

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


9E81 20 D1 9E   412  KBDINTRC JSR SAVREG
9E84 AD 51 AA   413           LDA CURSTAT         ;reading from a file?
9E87 F0 15      414           BEQ >2
9E89            415  ;
9E89            416  ; If so, remove cursor from screen
9E89            417  ;
9E89 48         418           PHA 
9E8A AD 5C AA   419           LDA ASAVE
9E8D 91 28      420           STA (BASE),Y
9E8F 68         421           PLA 
9E90 30 03      422           BMI >1              ;doing coldstart?
9E92 4C 26 A6   423           JMP READBYTE
9E95            424  ;
9E95            425  ;
9E95            426  ; special case for coldstart
9E95            427  ;
9E95 20 EA 9D   428  ^1       JSR FRSTIME
9E98 A4 24      429           LDY CH
9E9A A9 60      430           LDA #$60
9E9C 91 28      431           STA (BASE),Y
9E9E AD B3 AA   432  ^2       LDA EXFLG
9EA1 F0 03      433           BEQ >1
9EA3 20 82 A6   434           JSR EXECRD
9EA6 A9 03      435  ^1       LDA #3
9EA8 8D 52 AA   436           STA CSWSTATE
9EAB 20 BA 9F   437           JSR REGRST
9EAE 20 BA 9E   438           JSR RDCHAR
9EB1 8D 5C AA   439           STA ASAVE
9EB4 8E 5A AA   440           STX XSAVE
9EB7 4C B3 9F   441           JMP DOSXIT
9EBA 6C 38 00   442  RDCHAR   JMP (KSW)
9EBD            443  ;
9EBD            444  ;
9EBD            445  ; Video input state handler.
9EBD            446  ; Transfers control to the
9EBD            447  ; proper output handler.
9EBD            448  ;
9EBD 20 D1 9E   449  VIDINTRC JSR SAVREG
9EC0 AD 52 AA   450           LDA CSWSTATE
9EC3 0A         451           ASL 
9EC4 AA         452           TAX 
9EC5 BD 11 9D   453           LDA CSWSTADR+1,X
9EC8 48         454           PHA 
9EC9 BD 10 9D   455           LDA CSWSTADR,X
9ECC 48         456           PHA 
9ECD AD 5C AA   457           LDA ASAVE
9ED0 60         458           RTS                 ;Funny JMP (--)
9ED1            459  ;
9ED1            460  ;
9ED1            461  ; Register save routine
9ED1            462  ;
9ED1 8D 5C AA   463  SAVREG   STA ASAVE
9ED4 8E 5A AA   464           STX XSAVE
9ED7 8C 5B AA   465           STY YSAVE
9EDA BA         466           TSX 
9EDB E8         467           INX 
9EDC E8         468           INX 
9EDD 8E 59 AA   469           STX SSAVE

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


9EE0 A2 03      470           LDX #3
9EE2 BD 53 AA   471  ^1       LDA CSWL,X
9EE5 95 36      472           STA CSW,X
9EE7 CA         473           DEX 
9EE8 10 F8      474           BPL <1
9EEA 60         475           RTS 
9EEB            476  ;
9EEB            477  ;
9EEB            478  ; CSW STATE 0: Start of line.
9EEB            479  ; Check for control-D at
9EEB            480  ; beginning of line.
9EEB            481  ;
9EEB            482  ; If RUN command was delayed while
9EEB            483  ; loading A/S, continue RUN cmd.
9EEB            484  ;
9EEB AE B7 AA   485  CSWST0   LDX RUNINTRC
9EEE F0 03      486           BEQ >1
9EF0 4C 78 9F   487           JMP RUNDONE
9EF3            488  ;
9EF3            489  ; Check to see if a file is
9EF3            490  ; being read.
9EF3            491  ;
9EF3 AE 51 AA   492  ^1       LDX CURSTAT
9EF6 F0 08      493           BEQ >1
9EF8            494  ;
9EF8            495  ; If a file is being read, check
9EF8            496  ; to see if "?" prompt was output
9EF8            497  ;
9EF8 C9 BF      498           CMP #"?"            ;A/S PROMPT
9EFA F0 75      499           BEQ CSWST6
9EFC            500  ;
9EFC            501  ;
9EFC            502  ; See if at beginning of line
9EFC            503  ;
9EFC C5 33      504           CMP PROMPT
9EFE F0 27      505           BEQ CSWST2.1
9F00            506  ;
9F00            507  ; If not control-D at beginning
9F00            508  ; of line, goto state 2,
9F00            509  ;
9F00            510  ; otherwise go to state one and
9F00            511  ; collect possible DOS command.
9F00            512  ;
9F00 A2 02      513  ^1       LDX #2
9F02 8E 52 AA   514           STX CSWSTATE
9F05 CD B2 AA   515           CMP CTLD
9F08 D0 19      516           BNE CSWST2
9F0A CA         517           DEX 
9F0B 8E 52 AA   518           STX CSWSTATE
9F0E CA         519           DEX 
9F0F 8E 5D AA   520           STX CMDLNIDX
9F12            521  ;
9F12            522  ; Collect DOS command from
9F12            523  ; input line and parse
9F12            524  ;
9F12 AE 5D AA   525  CSWST1   LDX CMDLNIDX
9F15 9D 00 02   526  C1LP     STA IN,X
9F18 E8         527           INX 

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


9F19 8E 5D AA   528           STX CMDLNIDX
9F1C C9 8D      529           CMP #$8D
9F1E D0 75      530           BNE ECHOC
9F20 4C CD 9F   531           JMP PARSE
9F23            532  ;
9F23            533  ;
9F23            534  ;
9F23            535  ; CSW STATE 2 handler, Non-DOS
9F23            536  ; command.
9F23            537  ;
9F23            538  ; If current input character isn't
9F23            539  ; a return, exit DOS through ECHO,
9F23            540  ; otherwise reset command state
9F23            541  ; to zero.
9F23            542  ;
9F23 C9 8D      543  CSWST2   CMP #$8D
9F25 D0 7D      544           BNE ECHO
9F27 A2 00      545  CSWST2.1 LDX #0
9F29 8E 52 AA   546           STX CSWSTATE
9F2C 4C A4 9F   547           JMP ECHO
9F2F            548  ;
9F2F            549  ;
9F2F            550  ; STATE 3 handler- INPUT statement
9F2F            551  ; handler.
9F2F            552  ;
9F2F            553  ;
9F2F            554  ; set the command state to zero
9F2F            555  ; as a default (in case input
9F2F            556  ; ends).
9F2F            557  ;
9F2F A2 00      558  CSWST3   LDX #0
9F31 8E 52 AA   559           STX CSWSTATE
9F34 C9 8D      560           CMP #$8D
9F36 F0 07      561           BEQ >1
9F38            562  ;
9F38            563  ; If not at end of input, check
9F38            564  ; the exec flag.
9F38            565  ; If set, echo character only if
9F38            566  ; MON I is set or exec is active
9F38            567  ; In either case the state will be
9F38            568  ; reset to three.
9F38            569  ;
9F38            570  ;
9F38 AD B3 AA   571  C3CHKEXC LDA EXFLG
9F3B F0 67      572           BEQ ECHO
9F3D D0 5E      573           BNE ECHOI
9F3F            574  ;
9F3F            575  ;
9F3F            576  ;  Come here if EOLN encountered.
9F3F            577  ; If BASIC is not running, or
9F3F            578  ; EXECing a file goto state one
9F3F            579  ; and check for a possible DOS
9F3F            580  ; command.  Otherwise exit DOS
9F3F            581  ; echoing character as appropriate
9F3F            582  ; after switching to state 1
9F3F            583  ;
9F3F            584  ;
9F3F            585  ;

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


9F3F 48         586  ^1       PHA 
9F40 38         587           SEC 
9F41 AD B3 AA   588           LDA EXFLG
9F44 D0 03      589           BNE >1
9F46 20 5E A6   590           JSR ISBASRUN
9F49 68         591  ^1       PLA 
9F4A 90 EC      592           BCC C3CHKEXC
9F4C AE 5A AA   593           LDX XSAVE
9F4F 4C 15 9F   594           JMP C1LP
9F52            595  ;
9F52            596  ;
9F52            597  ; STATE 4 handler.
9F52            598  ; Write data to a file.
9F52            599  ;
9F52            600  ; check for EOLN, switch to
9F52            601  ; state 5 if <cr> encountered.
9F52            602  ;
9F52 C9 8D      603  CSWST4   CMP #$8D
9F54 D0 05      604           BNE >1
9F56 A9 05      605           LDA #5
9F58 8D 52 AA   606           STA CSWSTATE
9F5B 20 0E A6   607  ^1       JSR WRTBYTE
9F5E 4C 99 9F   608           JMP ECHOO
9F61            609  ;
9F61            610  ;
9F61            611  ; STATE 5 handler, start of
9F61            612  ; write data line; check for CTL-D
9F61            613  ;
9F61 CD B2 AA   614  CSWST5   CMP CTLD
9F64 F0 85      615           BEQ CSWST0
9F66            616  ;
9F66            617  ; treat any linefeeds as a
9F66            618  ; continuation of the previous
9F66            619  ; line.
9F66            620  ;
9F66 C9 8A      621           CMP #$8A
9F68 F0 F1      622           BEQ <1
9F6A            623  ;
9F6A            624  ; Otherwise revert to state 4
9F6A            625  ;
9F6A A2 04      626           LDX #4
9F6C 8E 52 AA   627           STX CSWSTATE
9F6F D0 E1      628           BNE CSWST4
9F71            629  ;
9F71            630  ; STATE 6 handler, skip output of
9F71            631  ; prompt character.
9F71            632  ;
9F71 A9 00      633  CSWST6   LDA #0
9F73 8D 52 AA   634           STA CSWSTATE
9F76 F0 25      635           BEQ ECHOI
9F78            636  ;
9F78            637  ;
9F78            638  ;
9F78            639  ; Finish RUN command interrupted
9F78            640  ; by RAM A/S load.
9F78            641  ;
9F78 A9 00      642  RUNDONE  LDA #0
9F7A 8D B7 AA   643           STA RUNINTRC

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


9F7D 20 51 A8   644           JSR INITPTRS
9F80 4C DC A4   645           JMP DORUN.1
9F83            646  ;
9F83            647  ;
9F83            648  ; End of DOS cmd scan.
9F83            649  ; Remove DOS command and pretend
9F83            650  ; the user only pressed return
9F83            651  ;
9F83 AD 00 02   652  SCNXIT   LDA IN
9F86 CD B2 AA   653           CMP CTLD
9F89 F0 0A      654           BEQ ECHOC
9F8B A9 8D      655           LDA #$8D
9F8D 8D 00 02   656           STA IN
9F90 A2 00      657           LDX #0
9F92 8E 5A AA   658           STX XSAVE
9F95            659  ;
9F95            660  ;
9F95            661  ; Echo character conditionally to
9F95            662  ; the screen:
9F95            663  ;
9F95            664  ;  ECHOC - IF MON C
9F95            665  ;  ECHOO - IF MON O
9F95            666  ;  ECHOI - IF MON I
9F95            667  ;
9F95            668  ;  ECHO  - UNCONDITIONALLY
9F95            669  ;
9F95 A9 40      670  ECHOC    LDA #$40
9F97 D0 06      671           BNE >1
9F99 A9 10      672  ECHOO    LDA #$10
9F9B D0 02      673           BNE >1
9F9D A9 20      674  ECHOI    LDA #$20
9F9F 2D 5E AA   675  ^1       AND MONFLGS
9FA2 F0 0F      676           BEQ DOSXIT
9FA4 20 BA 9F   677  ECHO     JSR REGRST
9FA7 20 C5 9F   678           JSR COUT
9FAA 8D 5C AA   679           STA ASAVE
9FAD 8C 5B AA   680           STY YSAVE
9FB0 8E 5A AA   681           STX XSAVE
9FB3            682  ;
9FB3            683  ;
9FB3            684  ; Restore registers and exit DOS
9FB3            685  ;
9FB3 20 51 A8   686  DOSXIT   JSR INITPTRS
9FB6 AE 59 AA   687           LDX SSAVE
9FB9 9A         688           TXS 
9FBA AD 5C AA   689  REGRST   LDA ASAVE
9FBD AC 5B AA   690           LDY YSAVE
9FC0 AE 5A AA   691           LDX XSAVE
9FC3 38         692           SEC 
9FC4 60         693           RTS 
9FC5            694  ;
9FC5            695  ;
9FC5            696  ; COUT and CRLF routines
9FC5            697  ;
9FC5 6C 36 00   698  COUT     JMP (CSW)
9FC8 A9 8D      699  CRLF     LDA #$8D
9FCA 4C C5 9F   700           JMP COUT
9FCD            701  ;

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


9FCD            702  ;
9FCD            703  ; Parse DOS command and check
9FCD            704  ; syntax
9FCD            705  ;
9FCD A0 FF      706  PARSE    LDY #$FF
9FCF 8C 5F AA   707           STY CMDINDX         ;set to 0 (see ADDCHR)
9FD2 C8         708           INY 
9FD3 8C 62 AA   709           STY PENDCMD
9FD6            710  ;
9FD6            711  ; get successive characters from
9FD6            712  ; input buffer and compare against
9FD6            713  ; current command in table
9FD6            714  ;
9FD6 EE 5F AA   715  ADDCHR   INC CMDINDX
9FD9 A2 00      716           LDX #0
9FDB 08         717           PHP                 ;assume "="
9FDC BD 00 02   718           LDA IN,X            ;skip any control-D's
9FDF CD B2 AA   719           CMP CTLD
9FE2 D0 01      720           BNE >1
9FE4 E8         721           INX 
9FE5 8E 5D AA   722  ^1       STX CMDLNIDX
9FE8 20 A4 A1   723  ^2       JSR FLSHCMDL        ;skip blanks
9FEB 29 7F      724           AND #$7F
9FED 59 84 A8   725           EOR DOSCMDS,Y       ;compare to char in table
9FF0 C8         726           INY 
9FF1            727  ;
9FF1            728  ; the following code is a tricky
9FF1            729  ; way of determining if the entire
9FF1            730  ; string is equal to one of the
9FF1            731  ; DOS commands
9FF1            732  ;
9FF1 0A         733           ASL 
9FF2 F0 02      734           BEQ >1
9FF4 68         735           PLA 
9FF5 08         736           PHP 
9FF6 90 F0      737  ^1       BCC <2
9FF8 28         738           PLP 
9FF9 F0 20      739           BEQ CMPUTIDX
9FFB B9 84 A8   740           LDA DOSCMDS,Y
9FFE D0 D6      741           BNE ADDCHR          ;at last command?
A000            742  ;
A000            743  ; If command was not found, see if
A000            744  ; first character on the line was
A000            745  ; control-D, if so SYNTAX ERROR!!!
A000            746  ;
A000 AD 00 02   747  GETFRST  LDA IN
A003 CD B2 AA   748           CMP CTLD
A006 F0 03      749           BEQ >1
A008 4C A4 9F   750           JMP ECHO
A00B AD 01 02   751  ^1       LDA IN+1
A00E C9 8D      752           CMP #$8D
A010 D0 06      753           BNE >1
A012 20 5B A7   754           JSR RSET0
A015 4C 95 9F   755           JMP ECHOC
A018 4C C4 A6   756  ^1       JMP CSYNERR
A01B            757  ;
A01B            758  ;
A01B            759  ; Valid DOS command, get its

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


A01B            760  ; address and execute it.
A01B            761  ;
A01B 0E 5F AA   762  CMPUTIDX ASL CMDINDX
A01E AC 5F AA   763           LDY CMDINDX
A021 20 5E A6   764           JSR ISBASRUN
A024 90 0C      765           BCC >1
A026            766  ;
A026            767  ; Certain commands (such as OPEN,
A026            768  ; etc.) can only be executed if
A026            769  ; BASIC is running.  If such a
A026            770  ; command is executed and BASIC
A026            771  ; is not running, fall through
A026            772  ; to here.
A026            773  ;
A026 A9 02      774           LDA #2
A028 39 09 A9   775           AND KWRDPRMS,Y
A02B F0 05      776           BEQ >1
A02D            777  ;
A02D            778  ; NOT A DIRECT COMMAND
A02D            779  ;
A02D A9 0F      780           LDA #$F
A02F 4C D2 A6   781           JMP DOERROR
A032            782  ;
A032            783  ;
A032 C0 06      784  ^1       CPY #6
A034 D0 02      785           BNE >1
A036 84 33      786           STY PROMPT
A038            787  ;
A038            788  ;
A038            789  ; See if a filename is required
A038            790  ;
A038 A9 20      791  ^1       LDA #$20
A03A 39 09 A9   792           AND KWRDPRMS,Y
A03D F0 61      793           BEQ FNDNONAM
A03F            794  ;
A03F            795  ; If a filename is needed, blank
A03F            796  ; out the filename arrays and
A03F            797  ; collect a filename (if found)
A03F            798  ;
A03F 20 95 A0   799           JSR BLKNAMES
A042 08         800           PHP 
A043            801  ;
A043            802  ; skip any leading blanks
A043            803  ;
A043 20 A4 A1   804  CI.1     JSR FLSHCMDL
A046 F0 1E      805           BEQ >2
A048 0A         806           ASL 
A049 90 05      807           BCC >1
A04B 30 03      808           BMI >1
A04D 4C 00 A0   809           JMP GETFRST
A050 6A         810  ^1       ROR 
A051 4C 59 A0   811           JMP >1
A054 20 93 A1   812  CLRNAME  JSR GNXTCHR
A057 F0 0D      813           BEQ >2
A059 99 75 AA   814  ^1       STA FNAME,Y
A05C C8         815           INY 
A05D C0 3C      816           CPY #$3C
A05F 90 F3      817           BCC CLRNAME

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


A061 20 93 A1   818  ^1       JSR GNXTCHR
A064 D0 FB      819           BNE <1
A066 28         820  ^2       PLP 
A067 D0 0F      821           BNE >1
A069 AC 5F AA   822           LDY CMDINDX
A06C A9 10      823           LDA #$10
A06E 39 09 A9   824           AND KWRDPRMS,Y
A071 F0 0C      825           BEQ >2
A073 A0 1E      826           LDY #$1E
A075 08         827           PHP 
A076 D0 CB      828           BNE CI.1
A078 AD 93 AA   829  ^1       LDA SFNAME
A07B C9 A0      830           CMP #$A0
A07D F0 13      831           BEQ CHKFRST
A07F AD 75 AA   832  ^2       LDA FNAME
A082 C9 A0      833           CMP #$A0
A084 D0 4B      834           BNE SETDFLTS
A086 AC 5F AA   835           LDY CMDINDX
A089 A9 C0      836           LDA #$C0
A08B 39 09 A9   837           AND KWRDPRMS,Y
A08E F0 02      838           BEQ CHKFRST
A090 10 3F      839           BPL SETDFLTS
A092 4C 00 A0   840  CHKFRST  JMP GETFRST
A095            841  ;
A095            842  ;
A095            843  ; subroutine to blank out the
A095            844  ; filenames.
A095            845  ;
A095 A0 3C      846  BLKNAMES LDY #$3C
A097 A9 A0      847  BLKN2    LDA #$A0
A099 99 74 AA   848  ^1       STA MONVAL,Y
A09C 88         849           DEY 
A09D D0 FA      850           BNE <1
A09F 60         851           RTS 
A0A0            852  ;
A0A0            853  ;
A0A0            854  ; Branch here if no filename
A0A0            855  ; is required.
A0A0            856  ;
A0A0 8D 75 AA   857  FNDNONAM STA FNAME
A0A3            858  ;
A0A3            859  ; check parameter table to see
A0A3            860  ; if a positional parameter is
A0A3            861  ; required.
A0A3            862  ;
A0A3 A9 0C      863           LDA #$C
A0A5 39 09 A9   864           AND KWRDPRMS,Y
A0A8 F0 27      865           BEQ SETDFLTS
A0AA            866  ;
A0AA            867  ; If so, read in the number
A0AA            868  ;
A0AA 20 B9 A1   869           JSR GETNUM
A0AD            870  ;
A0AD            871  ; was number ommitted?
A0AD            872  ;
A0AD B0 1F      873           BCS FNN.2
A0AF A8         874           TAY 
A0B0 D0 17      875           BNE FNN.1

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


A0B2            876  ;
A0B2            877  ; check the range of the number
A0B2            878  ;
A0B2 E0 11      879           CPX #$11
A0B4 B0 13      880           BCS FNN.1
A0B6 AC 5F AA   881           LDY CMDINDX
A0B9 A9 08      882           LDA #8
A0BB 39 09 A9   883           AND KWRDPRMS,Y
A0BE F0 06      884           BEQ >1
A0C0 E0 08      885           CPX #8
A0C2 B0 CE      886           BCS CHKFRST
A0C4            887  ;
A0C4            888  ; if # within range, set defaults
A0C4            889  ;
A0C4 90 0B      890           BCC SETDFLTS
A0C6 8A         891  ^1       TXA 
A0C7 D0 08      892           BNE SETDFLTS
A0C9 A9 02      893  FNN.1    LDA #2
A0CB 4C D2 A6   894           JMP DOERROR
A0CE 4C C4 A6   895  FNN.2    JMP CSYNERR
A0D1            896  ;
A0D1            897  ;
A0D1            898  ; Set up defaults for the
A0D1            899  ; positional values
A0D1            900  ;
A0D1 A9 00      901  SETDFLTS LDA #0
A0D3 8D 65 AA   902           STA KYWRDFND
A0D6 8D 74 AA   903           STA MONVAL
A0D9 8D 66 AA   904           STA VOLVAL
A0DC 8D 6C AA   905           STA LENVAL
A0DF 8D 6D AA   906           STA LENVAL+1
A0E2 20 DC BF   907           JSR AJUSTBYT
A0E5 AD 5D AA   908           LDA CMDLNIDX
A0E8            909  ;
A0E8            910  ; Come here if positionals are
A0E8            911  ; required.
A0E8            912  ;
A0E8            913  ;
A0E8            914  ; First, skip any leading  blanks
A0E8            915  ;
A0E8 20 A4 A1   916  GETNXT   JSR FLSHCMDL
A0EB D0 1F      917           BNE >1
A0ED C9 8D      918           CMP #$8D
A0EF D0 F7      919           BNE GETNXT
A0F1            920  ;
A0F1            921  ; If at EOLN, make sure we
A0F1            922  ; have all the arguements
A0F1            923  ; we need.
A0F1            924  ;
A0F1 AE 5F AA   925           LDX CMDINDX
A0F4 AD 65 AA   926           LDA KYWRDFND
A0F7 1D 0A A9   927           ORA KWRDPRMS+1,X
A0FA 5D 0A A9   928           EOR KWRDPRMS+1,X
A0FD D0 93      929           BNE CHKFRST
A0FF AE 63 AA   930           LDX TEMP1
A102 F0 76      931           BEQ PROCMD
A104 8D 63 AA   932           STA TEMP1
A107 8E 5D AA   933           STX CMDLNIDX

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


A10A D0 DC      934           BNE GETNXT
A10C A2 0A      935  ^1       LDX #$A
A10E DD 40 A9   936  ^2       CMP PPARMS-1,X
A111 F0 05      937           BEQ >3
A113 CA         938           DEX 
A114 D0 F8      939           BNE <2
A116 F0 B6      940  ISLE     BEQ FNN.2
A118            941  ;
A118            942  ; As each positional arguement
A118            943  ; is encountered, make it as
A118            944  ; present in KYWRDFND
A118            945  ;
A118 BD 4A A9   946  ^3       LDA PARMBITS-1,X
A11B 30 47      947           BMI UPDATMON
A11D 0D 65 AA   948           ORA KYWRDFND
A120 8D 65 AA   949           STA KYWRDFND
A123 CA         950           DEX 
A124 8E 64 AA   951           STX KYWRDIDX
A127            952  ;
A127            953  ; get numeric value associated
A127            954  ; with the keyword.
A127            955  ;
A127 20 B9 A1   956           JSR GETNUM
A12A B0 A2      957           BCS FNN.2
A12C            958  ;
A12C            959  ; check the range of the value
A12C            960  ; following the keyword.
A12C            961  ;
A12C AD 64 AA   962           LDA KYWRDIDX
A12F 0A         963           ASL 
A130 0A         964           ASL 
A131 A8         965           TAY 
A132 A5 45      966           LDA OPRND+1
A134 D0 09      967           BNE >4
A136 A5 44      968           LDA OPRND
A138 D9 55 A9   969           CMP KWRANGE,Y
A13B 90 8C      970           BCC FNN.1
A13D A5 45      971           LDA OPRND+1
A13F D9 58 A9   972  ^4       CMP KWRANGE+3,Y
A142 90 0B      973           BCC >6
A144 D0 83      974  ^5       BNE FNN.1
A146 A5 44      975           LDA OPRND
A148 D9 57 A9   976           CMP KWRANGE+2,Y
A14B 90 02      977           BCC >6
A14D D0 F5      978           BNE <5
A14F AD 63 AA   979  ^6       LDA TEMP1
A152 D0 94      980           BNE GETNXT
A154            981  ;
A154            982  ; save value parsed in the keyword
A154            983  ; parameters table.
A154            984  ;
A154 98         985           TYA 
A155 4A         986           LSR 
A156 A8         987           TAY 
A157 A5 45      988           LDA OPRND+1
A159 99 67 AA   989           STA VOLVAL+1,Y
A15C A5 44      990           LDA OPRND
A15E 99 66 AA   991           STA VOLVAL,Y

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


A161 4C E8 A0   992  GNISLE   JMP GETNXT
A164            993  ;
A164            994  ;
A164            995  ; If O,I, or C was encountered in
A164            996  ; MON or NOMON, set appropriate 
A164            997  ; bits.
A164            998  ;
A164 48         999  UPDATMON PHA 
A165 A9 80     1000           LDA #$80
A167 0D 65 AA  1001           ORA KYWRDFND
A16A 8D 65 AA  1002           STA KYWRDFND
A16D 68        1003           PLA 
A16E 29 7F     1004           AND #$7F
A170 0D 74 AA  1005           ORA MONVAL
A173 8D 74 AA  1006           STA MONVAL
A176 D0 E9     1007           BNE GNISLE
A178 F0 9C     1008           BEQ ISLE
A17A           1009  ;
A17A           1010  ;
A17A           1011  ;
A17A           1012  ; Process valid DOS command
A17A           1013  ;
A17A 20 80 A1  1014  PROCMD   JSR DOCMD
A17D 4C 83 9F  1015           JMP SCNXIT
A180 20 5B A7  1016  DOCMD    JSR RSET0
A183 20 AE A1  1017           JSR CLRFMP
A186 AD 5F AA  1018           LDA CMDINDX
A189 AA        1019           TAX 
A18A BD 1F 9D  1020           LDA CMDTBL+1,X
A18D 48        1021           PHA 
A18E BD 1E 9D  1022           LDA CMDTBL,X
A191 48        1023           PHA 
A192 60        1024           RTS 
A193           1025  ;
A193           1026  ;
A193           1027  ; Get next character from command
A193           1028  ; line and check for a <cr> or
A193           1029  ; a comma.
A193           1030  ;
A193 AE 5D AA  1031  GNXTCHR  LDX CMDLNIDX
A196 BD 00 02  1032           LDA IN,X
A199 C9 8D     1033           CMP #$8D
A19B F0 06     1034           BEQ >7
A19D E8        1035           INX 
A19E 8E 5D AA  1036           STX CMDLNIDX
A1A1 C9 AC     1037           CMP #","
A1A3 60        1038  ^7       RTS 
A1A4           1039  ;
A1A4           1040  ;
A1A4           1041  ; FLSHCMDL- deletes leading blanks
A1A4           1042  ; from command line.  Z-flag is
A1A4           1043  ; returned set if "," or <cr> is
A1A4           1044  ; first non-blank encountered.
A1A4           1045  ;
A1A4           1046  ;
A1A4 20 93 A1  1047  FLSHCMDL JSR GNXTCHR
A1A7 F0 FA     1048           BEQ <7
A1A9 C9 A0     1049           CMP #$A0

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


A1AB F0 F7     1050           BEQ FLSHCMDL
A1AD 60        1051           RTS 
A1AE           1052  ;
A1AE           1053  ;
A1AE           1054  ; CLRFMP- clears file manager's
A1AE           1055  ; parameter area.
A1AE           1056  ;
A1AE A9 00     1057  CLRFMP   LDA #0
A1B0 A0 16     1058           LDY #$16
A1B2 99 BA B5  1059  ^8       STA FMOP-1,Y
A1B5 88        1060           DEY 
A1B6 D0 FA     1061           BNE <8
A1B8 60        1062           RTS 
A1B9           1063  ;
A1B9           1064  ;
A1B9           1065  ; GETNUM- converts numeric (in
A1B9           1066  ; ASCII) arguement to binary.
A1B9           1067  ;
A1B9           1068  ; DECIMAL and HEX are supported.
A1B9           1069  ;
A1B9 A9 00     1070  GETNUM   LDA #0
A1BB 85 44     1071           STA OPRND
A1BD 85 45     1072           STA OPRND+1
A1BF 20 A4 A1  1073           JSR FLSHCMDL
A1C2 08        1074           PHP 
A1C3 C9 A4     1075           CMP #"$"
A1C5 F0 3C     1076           BEQ HEXCONV
A1C7 28        1077           PLP 
A1C8 4C CE A1  1078           JMP GN.2
A1CB           1079  ;
A1CB           1080  ; Decimal input routine here
A1CB           1081  ;
A1CB 20 A4 A1  1082  GN.1     JSR FLSHCMDL
A1CE D0 06     1083  GN.2     BNE >9
A1D0 A6 44     1084           LDX OPRND
A1D2 A5 45     1085           LDA OPRND+1
A1D4 18        1086           CLC 
A1D5 60        1087           RTS 
A1D6           1088  ;
A1D6           1089  ; get current character, multiply
A1D6           1090  ; OPRND by 10, and add in numeric
A1D6           1091  ; value for current digit
A1D6           1092  ;
A1D6 38        1093  ^9       SEC 
A1D7 E9 B0     1094           SBC #"0"
A1D9 30 21     1095           BMI BADNUM
A1DB C9 0A     1096           CMP #$A
A1DD B0 1D     1097           BCS BADNUM
A1DF           1098  ;
A1DF           1099  ; multiply OPRND by 10
A1DF           1100  ; (OPRND*2 + OPRND*8)
A1DF           1101  ;
A1DF           1102  ; and add in digit value
A1DF           1103  ;
A1DF           1104  ;
A1DF 20 FE A1  1105           JSR MUL2
A1E2 65 44     1106           ADC OPRND
A1E4 AA        1107           TAX 

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


A1E5 A9 00     1108           LDA #0
A1E7 65 45     1109           ADC OPRND+1
A1E9 A8        1110           TAY 
A1EA 20 FE A1  1111           JSR MUL2
A1ED 20 FE A1  1112           JSR MUL2
A1F0 8A        1113           TXA 
A1F1 65 44     1114           ADC OPRND
A1F3 85 44     1115           STA OPRND
A1F5 98        1116           TYA 
A1F6 65 45     1117           ADC OPRND+1
A1F8 85 45     1118           STA OPRND+1
A1FA 90 CF     1119           BCC GN.1
A1FC 38        1120  BADNUM   SEC 
A1FD 60        1121           RTS 
A1FE           1122  ;
A1FE           1123  ; multiply OPRND by 2.
A1FE           1124  ;
A1FE 06 44     1125  MUL2     ASL OPRND
A200 26 45     1126           ROL OPRND+1
A202 60        1127           RTS 
A203           1128  ;
A203           1129  ;
A203           1130  ; HEX number here.
A203           1131  ;
A203 28        1132  HEXCONV  PLP 
A204 20 A4 A1  1133  HEXLOOP  JSR FLSHCMDL
A207 F0 C5     1134           BEQ GN.2
A209 38        1135           SEC 
A20A E9 B0     1136           SBC #$B0
A20C 30 EE     1137           BMI BADNUM
A20E C9 0A     1138           CMP #$A
A210 90 08     1139           BCC >1
A212 E9 07     1140           SBC #7
A214 30 E6     1141           BMI BADNUM
A216 C9 10     1142           CMP #$10
A218 B0 E2     1143           BCS BADNUM
A21A A2 04     1144  ^1       LDX #4
A21C 20 FE A1  1145  ^2       JSR MUL2
A21F CA        1146           DEX 
A220 D0 FA     1147           BNE <2
A222 05 44     1148           ORA OPRND
A224 85 44     1149           STA OPRND
A226 4C 04 A2  1150           JMP HEXLOOP
A229           1151  ;
A229           1152  ;
A229           1153  ; Do PR#n command
A229           1154  ;
A229 A5 44     1155  DOPRNUM  LDA OPRND
A22B 4C 95 FE  1156           JMP OUTPRT
A22E           1157  ;
A22E           1158  ;
A22E           1159  ; Do IN# command
A22E           1160  ;
A22E A5 44     1161  DOINNUM  LDA OPRND
A230 4C 8B FE  1162           JMP INPRT
A233           1163  ;
A233           1164  ;
A233           1165  ; Do MON and NOMON commands

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


A233           1166  ;
A233 AD 5E AA  1167  DOMON    LDA MONFLGS
A236 0D 74 AA  1168           ORA MONVAL
A239 8D 5E AA  1169           STA MONFLGS
A23C 60        1170           RTS 
A23D           1171  ;
A23D 2C 74 AA  1172  DONOMON  BIT MONVAL
A240 50 03     1173           BVC >3
A242 20 C8 9F  1174           JSR CRLF
A245 A9 70     1175  ^3       LDA #$70
A247 4D 74 AA  1176           EOR MONVAL
A24A 2D 5E AA  1177           AND MONFLGS
A24D 8D 5E AA  1178           STA MONFLGS
A250 60        1179           RTS 
A251           1180  ;
A251           1181  ;
A251           1182  ; Handle MAXFILES commmand
A251           1183  ;
A251 A9 00     1184  DOMXFLS  LDA #0
A253 8D B3 AA  1185           STA EXFLG
A256 A5 44     1186           LDA OPRND
A258 48        1187           PHA 
A259 20 16 A3  1188           JSR CLOSEALL
A25C 68        1189           PLA 
A25D 8D 57 AA  1190           STA MAXFILES
A260 4C D4 A7  1191           JMP INITBUFS
A263           1192  ;
A263           1193  ;
A263           1194  ; Handle DOS DELETE command
A263           1195  ;
A263 A9 05     1196  DODELETE LDA #5
A265 20 AA A2  1197           JSR CMDHNDL2        ;perform the delete.
A268           1198  ;
A268           1199  ; Free up the buffer used by
A268           1200  ; the delete command.
A268           1201  ;
A268 20 64 A7  1202           JSR LOCBUF
A26B A0 00     1203           LDY #0
A26D 98        1204           TYA 
A26E 91 40     1205           STA (FILEBUF),Y
A270 60        1206           RTS 
A271           1207  ;
A271           1208  ;
A271           1209  ; Handle LOCK and UNLOCK
A271           1210  ;
A271 A9 07     1211  DOLOCK   LDA #7
A273 D0 02     1212           BNE >4
A275 A9 08     1213  DOUNLOCK LDA #8
A277 20 AA A2  1214  ^4       JSR CMDHNDL2
A27A 4C EA A2  1215           JMP DOCLOSE
A27D           1216  ;
A27D           1217  ;
A27D           1218  ; Handle DOS verify command
A27D           1219  ;
A27D A9 0C     1220  DOVERIFY LDA #$C
A27F D0 F6     1221           BNE <4
A281           1222  ;
A281           1223  ;

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


A281           1224  ; Handle DOS RENAME command
A281           1225  ;
A281 AD 08 9D  1226  DORENAME LDA SFNADR
A284 8D BD B5  1227           STA NEWNAME
A287 AD 09 9D  1228           LDA SFNADR+1
A28A 8D BE B5  1229           STA NEWNAME+1
A28D A9 09     1230           LDA #9
A28F 8D 63 AA  1231           STA TEMP1
A292 20 C8 A2  1232           JSR CLOSOPN
A295 4C EA A2  1233           JMP DOCLOSE
A298           1234  ;
A298           1235  ;
A298           1236  ; APPEND command is handled here.
A298           1237  ; Just do an open and then read
A298           1238  ; the file until a $00 is
A298           1239  ; encountered.
A298           1240  ;
A298 20 A3 A2  1241  DOAPND   JSR DOOPEN
A29B 20 8C A6  1242  ^5       JSR RDTEXT
A29E D0 FB     1243           BNE <5
A2A0 4C 71 B6  1244           JMP APTCH2
A2A3           1245  ;
A2A3           1246  ;
A2A3           1247  ; OPEN a text file here
A2A3           1248  ;
A2A3 A9 00     1249  DOOPEN   LDA #0
A2A5 4C D5 A3  1250           JMP OPENTST
A2A8           1251  ;
A2A8           1252  ;
A2A8           1253  ; File manager setup used by the
A2A8           1254  ; various DOS commands
A2A8           1255  ;
A2A8 A9 01     1256  CMDHNDLR LDA #1
A2AA 8D 63 AA  1257  CMDHNDL2 STA TEMP1
A2AD AD 6C AA  1258           LDA LENVAL
A2B0 D0 0A     1259           BNE >6
A2B2 AD 6D AA  1260           LDA LENVAL+1
A2B5 D0 05     1261           BNE >6
A2B7 A9 01     1262           LDA #1
A2B9 8D 6C AA  1263           STA LENVAL
A2BC AD 6C AA  1264  ^6       LDA LENVAL
A2BF 8D BD B5  1265           STA RECNUM
A2C2 AD 6D AA  1266           LDA LENVAL+1
A2C5 8D BE B5  1267           STA RECNUM+1
A2C8           1268  ;
A2C8           1269  ; Close a file if already open.
A2C8           1270  ;
A2C8 20 EA A2  1271  CLOSOPN  JSR DOCLOSE
A2CB A5 45     1272           LDA OPRND+1
A2CD D0 03     1273           BNE >7
A2CF 4C C8 A6  1274           JMP NOBUF
A2D2 85 41     1275  ^7       STA FILEBUF+1
A2D4 A5 44     1276           LDA OPRND
A2D6 85 40     1277           STA FILEBUF
A2D8 20 43 A7  1278           JSR COPYFNAM
A2DB 20 4E A7  1279           JSR COPYPTRS
A2DE 20 1A A7  1280           JSR COPYPARM
A2E1 AD 63 AA  1281           LDA TEMP1

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


A2E4 8D BB B5  1282           STA FMOP
A2E7 4C A8 A6  1283           JMP FMDRVR
A2EA           1284  ;
A2EA           1285  ;
A2EA           1286  ; DOS CLOSE command
A2EA           1287  ;
A2EA AD 75 AA  1288  DOCLOSE  LDA FNAME
A2ED C9 A0     1289           CMP #$A0
A2EF F0 25     1290           BEQ CLOSEALL
A2F1 20 64 A7  1291           JSR LOCBUF
A2F4 B0 3A     1292           BCS RTS0
A2F6 20 FC A2  1293           JSR CLOSFREE
A2F9 4C EA A2  1294           JMP DOCLOSE
A2FC           1295  ;
A2FC           1296  ;
A2FC           1297  ; FREE any buffers used by file
A2FC           1298  ; being closed.
A2FC           1299  ;
A2FC 20 AF A7  1300  CLOSFREE JSR ISEXCBUF
A2FF D0 05     1301           BNE >8
A301 A9 00     1302           LDA #0
A303 8D B3 AA  1303           STA EXFLG
A306 A0 00     1304  ^8       LDY #0
A308 98        1305           TYA 
A309 91 40     1306           STA (FILEBUF),Y
A30B 20 4E A7  1307           JSR COPYPTRS
A30E A9 02     1308           LDA #2
A310 8D BB B5  1309           STA FMOP
A313 4C A8 A6  1310           JMP FMDRVR
A316           1311  ;
A316           1312  ;
A316           1313  ; Close all open files
A316           1314  ;
A316 20 92 A7  1315  CLOSEALL JSR FRSTBUF
A319 D0 05     1316           BNE >0
A31B 20 9A A7  1317  ^9       JSR PNTNXTBF
A31E F0 10     1318           BEQ RTS0
A320 20 AF A7  1319  ^0       JSR ISEXCBUF
A323 F0 F6     1320           BEQ <9
A325 20 AA A7  1321           JSR GFBFNAM
A328 F0 F1     1322           BEQ <9
A32A 20 FC A2  1323           JSR CLOSFREE
A32D 4C 16 A3  1324           JMP CLOSEALL
A330 60        1325  RTS0     RTS 
A331           1326  ;
A331           1327  ;
A331           1328  ; DOS BSAVE COMMAND
A331           1329  ;
A331 A9 09     1330  DOBSAVE  LDA #9              ;check parameters
A333 2D 65 AA  1331           AND KYWRDFND
A336 C9 09     1332           CMP #9
A338 F0 03     1333           BEQ >1
A33A 4C 00 A0  1334           JMP GETFRST
A33D           1335  ;
A33D           1336  ; Open file and make sure it's
A33D           1337  ; Binary.
A33D           1338  ;
A33D A9 04     1339  ^1       LDA #4

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


A33F 20 D5 A3  1340           JSR OPENTST
A342           1341  ;
A342           1342  ; Init address parameters
A342           1343  ;
A342 AD 73 AA  1344           LDA ADRVAL+1
A345 AC 72 AA  1345           LDY ADRVAL
A348 20 E0 A3  1346           JSR WRT2
A34B AD 6D AA  1347           LDA LENVAL+1
A34E AC 6C AA  1348           LDY LENVAL
A351 20 E0 A3  1349           JSR WRT2
A354 AD 73 AA  1350           LDA ADRVAL+1
A357 AC 72 AA  1351           LDY ADRVAL
A35A 4C FF A3  1352           JMP RWRANGE
A35D           1353  ;
A35D           1354  ;
A35D           1355  ; DOS BLOAD COMMAND
A35D           1356  ;
A35D 20 A8 A2  1357  DOBLOAD  JSR CMDHNDLR
A360           1358  ;
A360           1359  ; Make sure it is a binary file
A360           1360  ;
A360 A9 7F     1361           LDA #$7F
A362 2D C2 B5  1362           AND FILETYPE
A365 C9 04     1363           CMP #4
A367 F0 03     1364           BEQ >2
A369 4C D0 A6  1365           JMP FMISMTCH
A36C A9 04     1366  ^2       LDA #4
A36E 20 D5 A3  1367           JSR OPENTST
A371           1368  ;
A371           1369  ; Read in length and address
A371           1370  ; values.
A371           1371  ;
A371 20 7A A4  1372           JSR RD2
A374 AA        1373           TAX 
A375 AD 65 AA  1374           LDA KYWRDFND
A378 29 01     1375           AND #1
A37A D0 06     1376           BNE >2
A37C 8E 72 AA  1377           STX ADRVAL
A37F 8C 73 AA  1378           STY ADRVAL+1
A382 20 7A A4  1379  ^2       JSR RD2
A385 AE 72 AA  1380           LDX ADRVAL
A388 AC 73 AA  1381           LDY ADRVAL+1
A38B 4C 71 A4  1382           JMP RWSETUP
A38E           1383  ;
A38E           1384  ;
A38E           1385  ; Handle BRUN command
A38E           1386  ;
A38E 20 5D A3  1387  DOBRUN   JSR DOBLOAD
A391 20 51 A8  1388           JSR INITPTRS
A394 6C 72 AA  1389           JMP (ADRVAL)
A397           1390  ;
A397           1391  ;
A397           1392  ; Handle DOS SAVE command 
A397           1393  ;
A397 AD B6 AA  1394  DOSAVE   LDA WHCBASIC
A39A F0 20     1395           BEQ ISINT
A39C           1396  ;
A39C           1397  ; Applesoft BASIC at this point

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


A39C           1398  ;
A39C           1399  ;
A39C           1400  ; Is source protected?
A39C           1401  ;
A39C A5 D6     1402           LDA PROTECT
A39E 10 03     1403           BPL >3
A3A0 4C CC A6  1404           JMP PTOOBIG
A3A3 A9 02     1405  ^3       LDA #2
A3A5 20 D5 A3  1406           JSR OPENTST
A3A8 38        1407           SEC 
A3A9 A5 AF     1408           LDA ASPEND
A3AB E5 67     1409           SBC ASPGMST
A3AD A8        1410           TAY 
A3AE A5 B0     1411           LDA ASPEND+1
A3B0 E5 68     1412           SBC ASPGMST+1
A3B2 20 E0 A3  1413           JSR WRT2
A3B5 A5 68     1414           LDA ASPGMST+1
A3B7 A4 67     1415           LDY ASPGMST
A3B9 4C FF A3  1416           JMP RWRANGE
A3BC           1417  ;
A3BC           1418  ; Saving integer BASIC
A3BC           1419  ;
A3BC A9 01     1420  ISINT    LDA #1
A3BE 20 D5 A3  1421           JSR OPENTST
A3C1 38        1422           SEC 
A3C2 A5 4C     1423           LDA INTHIMEM
A3C4 E5 CA     1424           SBC INTSTRT
A3C6 A8        1425           TAY 
A3C7 A5 4D     1426           LDA INTHIMEM+1
A3C9 E5 CB     1427           SBC INTSTRT+1
A3CB 20 E0 A3  1428           JSR WRT2
A3CE A5 CB     1429           LDA INTSTRT+1
A3D0 A4 CA     1430           LDY INTSTRT
A3D2 4C FF A3  1431           JMP RWRANGE
A3D5           1432  ;
A3D5           1433  ; Open a file and check its type
A3D5           1434  ;
A3D5 8D C2 B5  1435  OPENTST  STA FILETYPE
A3D8 48        1436           PHA 
A3D9 20 A8 A2  1437           JSR CMDHNDLR
A3DC 68        1438           PLA 
A3DD 4C C4 A7  1439           JMP CHKTYPE
A3E0           1440  ;
A3E0           1441  ; Write two bytes out to a file
A3E0           1442  ;
A3E0 8C C1 B5  1443  WRT2     STY RANGELEN
A3E3 8C C3 B5  1444           STY DATARANG
A3E6 8D C2 B5  1445           STA RANGELEN+1
A3E9 A9 04     1446           LDA #4
A3EB 8D BB B5  1447           STA FMOP
A3EE A9 01     1448           LDA #1
A3F0 8D BC B5  1449           STA FMSUBOP
A3F3 20 A8 A6  1450           JSR FMDRVR
A3F6 AD C2 B5  1451           LDA RANGELEN+1
A3F9 8D C3 B5  1452           STA DATARANG
A3FC 4C A8 A6  1453           JMP FMDRVR
A3FF           1454  ;
A3FF           1455  ;

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


A3FF           1456  ; Read or Write a range of bytes
A3FF           1457  ;
A3FF 8C C3 B5  1458  RWRANGE  STY DATARANG
A402 8D C4 B5  1459           STA DATARANG+1
A405 A9 02     1460           LDA #2
A407 4C 86 B6  1461           JMP VFYPTCH
A40A 20 A8 A6  1462  RWR.2    JSR FMDRVR
A40D 4C EA A2  1463           JMP DOCLOSE
A410 4C D0 A6  1464  FTMIS    JMP FMISMTCH
A413           1465  ;
A413           1466  ;
A413           1467  ; Do BASIC LOAD
A413           1468  ;
A413 20 16 A3  1469  DOLOAD   JSR CLOSEALL
A416 20 A8 A2  1470  DOLD.2   JSR CMDHNDLR
A419 A9 23     1471           LDA #$23            ;is type INT, RAM A/S or ROM A/S?
A41B 2D C2 B5  1472           AND FILETYPE
A41E F0 F0     1473           BEQ FTMIS
A420 8D C2 B5  1474           STA FILETYPE
A423 AD B6 AA  1475           LDA WHCBASIC
A426 F0 28     1476           BEQ >7
A428           1477  ;
A428           1478  ; select Applesoft
A428           1479  ;
A428 A9 02     1480           LDA #2
A42A 20 B1 A4  1481           JSR SELBASIC
A42D           1482  ;
A42D           1483  ;
A42D           1484  ; Read in length of A/S program
A42D           1485  ;
A42D 20 7A A4  1486           JSR RD2
A430           1487  ;
A430           1488  ;
A430           1489  ; compute A/S pointer values
A430           1490  ;
A430 18        1491           CLC 
A431 65 67     1492           ADC ASPGMST
A433 AA        1493           TAX 
A434 98        1494           TYA 
A435 65 68     1495           ADC ASPGMST+1
A437 C5 74     1496           CMP ASHIMEM+1
A439 B0 70     1497           BCS PTOOLRG
A43B 85 B0     1498           STA ASPEND+1
A43D 85 6A     1499           STA ASVARS+1
A43F 86 AF     1500           STX ASPEND
A441 86 69     1501           STX ASVARS
A443 A6 67     1502           LDX ASPGMST
A445 A4 68     1503           LDY ASPGMST+1
A447 20 71 A4  1504           JSR RWSETUP
A44A 20 51 A8  1505           JSR INITPTRS
A44D 6C 60 9D  1506           JMP (ASFTREL)
A450           1507  ;
A450           1508  ; select integer BASIC and load
A450           1509  ; integer program
A450           1510  ;
A450 A9 01     1511  ^7       LDA #1
A452 20 B1 A4  1512           JSR SELBASIC
A455 20 7A A4  1513           JSR RD2

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


A458 38        1514           SEC 
A459 A5 4C     1515           LDA INTHIMEM
A45B ED 60 AA  1516           SBC LOADLEN
A45E AA        1517           TAX 
A45F A5 4D     1518           LDA INTHIMEM+1
A461 ED 61 AA  1519           SBC LOADLEN+1
A464 90 45     1520           BCC PTOOLRG
A466 A8        1521           TAY 
A467 C4 4B     1522           CPY INTLOMEM+1
A469 90 40     1523           BCC PTOOLRG
A46B F0 3E     1524           BEQ PTOOLRG
A46D 84 CB     1525           STY INTSTRT+1
A46F 86 CA     1526           STX INTSTRT
A471           1527  ;
A471           1528  ;
A471           1529  ; Read or Write the range of bytes
A471           1530  ; required.
A471           1531  ;
A471 8E C3 B5  1532  RWSETUP  STX DATARANG
A474 8C C4 B5  1533           STY DATARANG+1
A477 4C 0A A4  1534           JMP RWR.2
A47A           1535  ;
A47A           1536  ;
A47A           1537  ; Read two bytes from the
A47A           1538  ; specified file.
A47A           1539  ;
A47A AD 0A 9D  1540  RD2      LDA LDRNGLEN
A47D 8D C3 B5  1541           STA DATARANG
A480 AD 0B 9D  1542           LDA LDRNGLEN+1
A483 8D C4 B5  1543           STA DATARANG+1
A486 A9 00     1544           LDA #0
A488 8D C2 B5  1545           STA RANGELEN+1
A48B A9 02     1546           LDA #2
A48D 8D C1 B5  1547           STA RANGELEN
A490 A9 03     1548           LDA #3
A492 8D BB B5  1549           STA FMOP
A495 A9 02     1550           LDA #2
A497 8D BC B5  1551           STA FMSUBOP
A49A 20 A8 A6  1552           JSR FMDRVR
A49D AD 61 AA  1553           LDA LOADLEN+1
A4A0 8D C2 B5  1554           STA RANGELEN+1
A4A3 A8        1555           TAY 
A4A4 AD 60 AA  1556           LDA LOADLEN
A4A7 8D C1 B5  1557           STA RANGELEN
A4AA 60        1558           RTS 
A4AB           1559  ;
A4AB           1560  ; Print "PROGRAM TOO LARGE"
A4AB           1561  ;
A4AB 20 EA A2  1562  PTOOLRG  JSR DOCLOSE
A4AE 4C CC A6  1563           JMP PTOOBIG
A4B1           1564  ;
A4B1           1565  ; Select a BASIC.
A4B1           1566  ; If BASIC matches filetype, quit.
A4B1           1567  ; If not, select alternate BASIC.
A4B1           1568  ;
A4B1           1569  ;
A4B1           1570  ; See if the proper BASIC is
A4B1           1571  ; already selected.

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


A4B1           1572  ;
A4B1 CD C2 B5  1573  SELBASIC CMP FILETYPE
A4B4 F0 1A     1574           BEQ RTS1
A4B6           1575  ;
A4B6           1576  ; If not, save CMDINDX and
A4B6           1577  ; change BASICs
A4B6           1578  ;
A4B6 AE 5F AA  1579           LDX CMDINDX
A4B9 8E 62 AA  1580           STX PENDCMD
A4BC 4A        1581           LSR 
A4BD F0 03     1582           BEQ >9
A4BF 4C 9E A5  1583           JMP DOINT
A4C2           1584  ;
A4C2           1585  ; If changing to Applesoft,
A4C2           1586  ; save filename in case RAM
A4C2           1587  ; A/S is loading (remember,
A4C2           1588  ; RAM A/S is an integer program
A4C2           1589  ; called "APPLESOFT", during
A4C2           1590  ; its load it will wipe out
A4C2           1591  ; FNAME).
A4C2           1592  ;
A4C2 A2 1D     1593  ^9       LDX #$1D
A4C4 BD 75 AA  1594  ^0       LDA FNAME,X
A4C7 9D 93 AA  1595           STA SFNAME,X
A4CA CA        1596           DEX 
A4CB 10 F7     1597           BPL <0
A4CD 4C 7A A5  1598           JMP DOFP
A4D0 60        1599  RTS1     RTS 
A4D1           1600           ICL "CDI.PART2,D1"


A4D1              2           DCM "WRITE CDI.LIST"
A4D1              3  ;
A4D1              4  ;
A4D1              5  ; CDI.PART2
A4D1              6  ;
A4D1              7  ;
A4D1              8  ; Handle DOS RUN command
A4D1              9  ;
A4D1 AD B6 AA    10  DORUN    LDA WHCBASIC
A4D4 F0 03       11           BEQ >1
A4D6 8D B7 AA    12           STA RUNINTRC
A4D9 20 13 A4    13  ^1       JSR DOLOAD
A4DC 20 C8 9F    14  DORUN.1  JSR CRLF
A4DF 20 51 A8    15           JSR INITPTRS
A4E2 6C 58 9D    16           JMP (RUNADR)
A4E5             17  ;
A4E5             18  ;
A4E5             19  ; If integer BASIC, handle RUN
A4E5             20  ; command here.
A4E5             21  ;
A4E5 A5 4A       22  DOSIRUN  LDA INTLOMEM
A4E7 85 CC       23           STA INTVEND
A4E9 A5 4B       24           LDA INTLOMEM+1
A4EB 85 CD       25           STA INTVEND+1
A4ED 6C 56 9D    26           JMP (CHNADR)
A4F0             27  ;
A4F0             28  ;
A4F0             29  ; Handle CHAIN command

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


A4F0             30  ;
A4F0 20 16 A4    31  DOCHAIN  JSR DOLD.2
A4F3 20 C8 9F    32           JSR CRLF
A4F6 20 51 A8    33           JSR INITPTRS
A4F9 6C 56 9D    34           JMP (CHNADR)
A4FC             35  ;
A4FC             36  ;
A4FC             37  ;
A4FC             38  ;
A4FC             39  ; Applesoft CHAIN is simply a RUN
A4FC             40  ;
A4FC 20 65 D6    41  DOSARUN  JSR LD665
A4FF 85 33       42           STA PROMPT
A501 85 D8       43           STA ASONERR
A503 4C D2 D7    44           JMP LD7D2
A506 20 65 0E    45  DOSA2RUN JSR LE65
A509 85 33       46           STA PROMPT
A50B 85 D8       47           STA ASONERR
A50D 4C D4 0F    48           JMP LFD4
A510             49  ;
A510             50  ;
A510             51  ; Handle the DOS write command
A510             52  ;
A510 20 26 A5    53  DOWRITE  JSR RWCOMMON
A513 A9 05       54           LDA #5
A515 8D 52 AA    55           STA CSWSTATE
A518 4C 83 9F    56           JMP SCNXIT
A51B             57  ;
A51B             58  ; DOS READ command
A51B             59  ;
A51B 20 26 A5    60  DOREAD   JSR RWCOMMON
A51E A9 01       61           LDA #1
A520 8D 51 AA    62           STA CURSTAT
A523 4C 83 9F    63           JMP SCNXIT
A526             64  ;
A526             65  ; Code common to both read and
A526             66  ; write.
A526             67  ;
A526             68  ;
A526             69  ; First, see if a buffer is
A526             70  ; already allocated to the
A526             71  ; file.
A526             72  ;
A526 20 64 A7    73  RWCOMMON JSR LOCBUF
A529 90 06       74           BCC >2
A52B             75  ;
A52B             76  ; If not, open a file
A52B             77  ;
A52B 20 A3 A2    78           JSR DOOPEN
A52E 4C 34 A5    79           JMP >3
A531             80  ;
A531             81  ; If so, copy file buffer workspc
A531             82  ; to the file manager workspace
A531             83  ;
A531 20 4E A7    84  ^2       JSR COPYPTRS
A534             85  ;
A534             86  ; check to see if "R" or "B"
A534             87  ; parameters were specified.

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


A534             88  ;
A534 AD 65 AA    89  ^3       LDA KYWRDFND
A537 29 06       90           AND #6
A539 F0 13       91           BEQ RTS2
A53B             92  ;
A53B             93  ; If so, copy numeric operands
A53B             94  ; to the parameter list.
A53B             95  ;
A53B A2 03       96           LDX #3
A53D BD 6E AA    97  ^4       LDA RECVAL,X
A540 9D BD B5    98           STA RECNUM,X
A543 CA          99           DEX 
A544 10 F7      100           BPL <4
A546            101  ;
A546            102  ; Because R or B parameter was
A546            103  ; specified, a POSITION command
A546            104  ; must be issued before the
A546            105  ; read or write command.
A546            106  ;
A546 A9 0A      107           LDA #$A
A548 8D BB B5   108           STA FMOP
A54B 20 A8 A6   109           JSR FMDRVR
A54E 60         110  RTS2     RTS 
A54F            111  ;
A54F            112  ;
A54F            113  ; INIT command
A54F            114  ;
A54F            115  ;
A54F            116  ; If "V" parameter not specified,
A54F            117  ; or it was specified as 0,
A54F            118  ; default to 254
A54F            119  ;
A54F A9 40      120  DOINIT   LDA #$40
A551 2D 65 AA   121           AND KYWRDFND
A554 F0 05      122           BEQ >5
A556 AD 66 AA   123           LDA VOLVAL
A559 D0 05      124           BNE >6
A55B A9 FE      125  ^5       LDA #254
A55D 8D 66 AA   126           STA VOLVAL
A560            127  ;
A560            128  ; Get page # of DOS ($9D for
A560            129  ; 48K) and store in subcode
A560            130  ; field.
A560            131  ;
A560 AD 0D 9D   132  ^6       LDA LOADADR+1
A563 8D BC B5   133           STA FMSUBOP
A566            134  ;
A566            135  ; Do the INIT.
A566            136  ;
A566 A9 0B      137           LDA #$B
A568 20 AA A2   138           JSR CMDHNDL2
A56B 4C 97 A3   139           JMP DOSAVE
A56E            140  ;
A56E            141  ;
A56E            142  ; Catalog function handler
A56E            143  ;
A56E A9 06      144  DOCAT    LDA #6
A570 20 AA A2   145           JSR CMDHNDL2

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


A573            146  ;
A573            147  ; Set default volume to the
A573            148  ; volume number of the disk
A573            149  ; just cataloged.
A573            150  ;
A573 AD BF B5   151           LDA VOLUME
A576 8D 66 AA   152           STA VOLVAL
A579 60         153           RTS 
A57A            154  ;
A57A            155  ;
A57A            156  ; Change to Applesoft BASIC
A57A            157  ;
A57A            158  ;
A57A            159  ; Try to select ROM A/S
A57A            160  ;
A57A A9 4C      161  DOFP     LDA #$4C
A57C 20 B2 A5   162           JSR SETBASIC
A57F F0 2E      163           BEQ GOODFP
A581            164  ;
A581            165  ; Set up for integer BASIC
A581            166  ;
A581 A9 00      167           LDA #0
A583 8D B6 AA   168           STA WHCBASIC
A586            169  ;
A586            170  ; Attempt to load in RAM
A586            171  ; applesoft
A586            172  ;
A586 A0 1E      173           LDY #$1E
A588 20 97 A0   174           JSR BLKN2
A58B A2 09      175           LDX #9
A58D BD B7 AA   176  ^7       LDA LAAB7-1,X
A590 9D 74 AA   177           STA MONVAL,X
A593 CA         178           DEX 
A594 D0 F7      179           BNE <7
A596 A9 C0      180           LDA #$C0
A598 8D 51 AA   181           STA CURSTAT
A59B            182  ;
A59B            183  ; RUN APPLESOFT, if not present
A59B            184  ; on the disk you get the
A59B            185  ; FILE NOT FOUND message.
A59B            186  ; (when DOS restarts the RUN PGM
A59B            187  ; command will be finished).
A59B            188  ;
A59B 4C D1 A4   189           JMP DORUN
A59E            190  ;
A59E            191  ;
A59E            192  ; Change to integer BASIC
A59E            193  ;
A59E A9 20      194  DOINT    LDA #$20
A5A0 20 B2 A5   195           JSR SETBASIC
A5A3 F0 05      196           BEQ >8
A5A5            197  ;
A5A5            198  ; If it ain't thar, tuff luck 
A5A5            199  ;
A5A5 A9 01      200           LDA #1
A5A7 4C D2 A6   201           JMP DOERROR
A5AA            202  ;
A5AA            203  ; If it is there, restart DOS

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


A5AA            204  ;:
A5AA A9 00      205  ^8       LDA #0
A5AC 8D B7 AA   206           STA RUNINTRC
A5AF 4C 84 9D   207  GOODFP   JMP DOSSTRT
A5B2            208  ;
A5B2            209  ; Set the BASIC according to
A5B2            210  ; byte passed in acc
A5B2            211  ;
A5B2            212  ; Integer -  acc=$20
A5B2            213  ; APLSOFT -  acc=$4C
A5B2            214  ;
A5B2 CD 00 E0   215  SETBASIC CMP BASCLD
A5B5 F0 0E      216           BEQ RTS3
A5B7 8D 80 C0   217           STA RAM
A5BA CD 00 E0   218           CMP BASCLD
A5BD F0 06      219           BEQ RTS3
A5BF 8D 81 C0   220           STA ROM
A5C2 CD 00 E0   221           CMP BASCLD
A5C5 60         222  RTS3     RTS 
A5C6            223  ;
A5C6            224  ;
A5C6            225  ; Handle DOS' EXEC command
A5C6            226  ;
A5C6 20 A3 A2   227  DOEXEC   JSR DOOPEN
A5C9 AD 4F AA   228           LDA BUFADR
A5CC 8D B4 AA   229           STA EXCBUF
A5CF AD 50 AA   230           LDA BUFADR+1
A5D2 8D B5 AA   231           STA EXCBUF+1
A5D5 AD 75 AA   232           LDA FNAME
A5D8 8D B3 AA   233           STA EXFLG
A5DB D0 0E      234           BNE >2              ;handle possible "R" parameter
A5DD            235  ;
A5DD            236  ;
A5DD            237  ; Handle DOS' position command
A5DD            238  ;
A5DD 20 64 A7   239  DOPSTION JSR LOCBUF
A5E0 90 06      240           BCC >1
A5E2 20 A3 A2   241           JSR DOOPEN
A5E5 4C EB A5   242           JMP >2
A5E8 20 4E A7   243  ^1       JSR COPYPTRS
A5EB            244  ;
A5EB            245  ; check for "R" parameter
A5EB            246  ;
A5EB AD 65 AA   247  ^2       LDA KYWRDFND
A5EE 29 04      248           AND #4
A5F0 F0 1B      249           BEQ RTS5
A5F2            250  ;
A5F2            251  ;
A5F2            252  ; search for the record specified
A5F2            253  ; by the "R" parameter
A5F2            254  ;
A5F2 AD 6E AA   255  TSTRLOOP LDA RECVAL
A5F5 D0 08      256           BNE >3
A5F7 AE 6F AA   257           LDX RECVAL+1
A5FA F0 11      258           BEQ RTS5
A5FC CE 6F AA   259           DEC RECVAL+1
A5FF CE 6E AA   260  ^3       DEC RECVAL
A602 20 8C A6   261  ^4       JSR RDTEXT

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


A605 F0 38      262           BEQ RD.2
A607 C9 8D      263           CMP #$8D
A609 D0 F7      264           BNE <4
A60B F0 E5      265           BEQ TSTRLOOP
A60D 60         266  RTS5     RTS 
A60E            267  ;
A60E            268  ;
A60E            269  ; Write a byte to a file
A60E            270  ;
A60E            271  ;
A60E            272  ; Check to see if BASIC is
A60E            273  ; still running, close the
A60E            274  ; file if the user's program
A60E            275  ; stopped without closing the
A60E            276  ; file.
A60E            277  ;
A60E 20 5E A6   278  WRTBYTE  JSR ISBASRUN
A611 B0 66      279           BCS CLSWARM
A613            280  ;
A613            281  ; Get the character and output
A613            282  ; it to the specified file.
A613            283  ;
A613 AD 5C AA   284           LDA ASAVE
A616 8D C3 B5   285           STA DATARANG
A619 A9 04      286           LDA #4
A61B 8D BB B5   287           STA FMOP
A61E A9 01      288           LDA #1
A620 8D BC B5   289           STA FMSUBOP
A623 4C A8 A6   290           JMP FMDRVR
A626            291  ;
A626            292  ; Read a byte from a file
A626            293  ;
A626            294  ;
A626            295  ; Once again, make sure the
A626            296  ; program is still running.
A626            297  ; Close the file if it isn't
A626            298  ;
A626 20 5E A6   299  READBYTE JSR ISBASRUN
A629 B0 4E      300           BCS CLSWARM
A62B            301  ;
A62B            302  ; set up for state six (skip
A62B            303  ; output of prompt character)
A62B            304  ;
A62B A9 06      305           LDA #6
A62D 8D 52 AA   306  RDB.1    STA CSWSTATE
A630            307  ;
A630            308  ; Read a character from the file
A630            309  ;
A630 20 8C A6   310           JSR RDTEXT
A633 D0 0F      311           BNE TSTLWR
A635            312  ;
A635            313  ; If EOF, close file.
A635            314  ; If not in state 3 (EXEC) issue
A635            315  ; END of DATA message.
A635            316  ;
A635 20 FC A2   317           JSR CLOSFREE
A638 A9 03      318           LDA #3
A63A CD 52 AA   319           CMP CSWSTATE

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


A63D F0 CE      320           BEQ RTS5
A63F A9 05      321  RD.2     LDA #5
A641 4C D2 A6   322           JMP DOERROR
A644            323  ;
A644            324  ; If character was a lowercase
A644            325  ; character, strip its H.O.
A644            326  ; bit so the Apple Monitor doesn't
A644            327  ; convert it to upper case.
A644            328  ;
A644 C9 E0      329  TSTLWR   CMP #$E0
A646 90 02      330           BCC >5
A648 29 7F      331           AND #$7F
A64A 8D 5C AA   332  ^5       STA ASAVE
A64D AE 5A AA   333           LDX XSAVE
A650 F0 09      334           BEQ >6
A652            335  ;
A652            336  ; In the event the last character
A652            337  ; was a lower case character (and
A652            338  ; hence in the range $60-$7F),
A652            339  ; force the H.O. bit on.
A652            340  ;
A652 CA         341           DEX 
A653 BD 00 02   342           LDA IN,X
A656 09 80      343           ORA #$80
A658 9D 00 02   344           STA IN,X
A65B 4C B3 9F   345  ^6       JMP DOSXIT
A65E            346  ;
A65E            347  ;
A65E            348  ; Check to see if BASIC is
A65E            349  ; executing
A65E            350  ;
A65E 48         351  ISBASRUN PHA 
A65F            352  ;
A65F            353  ; See if Integer or Applesoft
A65F            354  ; is running.
A65F            355  ;
A65F AD B6 AA   356           LDA WHCBASIC
A662 F0 0E      357           BEQ >8
A664            358  ;
A664            359  ;
A664            360  ; A/S is running, first see if the
A664            361  ; linenumber's H.O. byte is $FF
A664            362  ; (not running).
A664            363  ;
A664 A6 76      364           LDX ASRUN
A666 E8         365           INX 
A667 F0 0D      366           BEQ NOTRUNNG
A669            367  ;
A669            368  ; Now see if the prompt is "]"
A669            369  ; (used only in immediate mode).
A669            370  ;
A669 A6 33      371           LDX PROMPT
A66B E0 DD      372           CPX #"]"
A66D F0 07      373           BEQ NOTRUNNG
A66F            374  ;
A66F 68         375  ISRUNING PLA 
A670 18         376           CLC 
A671 60         377           RTS 

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


A672            378  ;
A672            379  ; If integer BASIC is active,
A672            380  ; check the integer BASIC runmode
A672            381  ; flag (negative if running).
A672            382  ;
A672 A5 D9      383  ^8       LDA INTRUN
A674 30 F9      384           BMI ISRUNING
A676 68         385  NOTRUNNG PLA 
A677 38         386           SEC 
A678 60         387           RTS 
A679            388  ;
A679            389  ; CLSWARM- closes all files and
A679            390  ; warmstarts DOS.
A679            391  ;
A679 20 FC A2   392  CLSWARM  JSR CLOSFREE
A67C 20 5B A7   393           JSR RSET0
A67F 4C B3 9F   394           JMP DOSXIT
A682            395  ;
A682            396  ;
A682            397  ; Read a character from the EXEC
A682            398  ; file buffer.
A682            399  ;
A682 20 9D A6   400  EXECRD   JSR PNTEXEC
A685 20 4E A7   401           JSR COPYPTRS
A688 A9 03      402           LDA #3
A68A D0 A1      403           BNE RDB.1
A68C            404  ;
A68C            405  ;
A68C            406  ; Read a character from a text
A68C            407  ; file.
A68C            408  ;
A68C A9 03      409  RDTEXT   LDA #3
A68E 8D BB B5   410           STA FMOP
A691 A9 01      411           LDA #1
A693 8D BC B5   412           STA FMSUBOP
A696 20 A8 A6   413           JSR FMDRVR
A699 AD C3 B5   414           LDA DATARANG
A69C 60         415           RTS 
A69D            416  ;
A69D            417  ;
A69D            418  ; set up pointers for exec file
A69D            419  ;
A69D AD B5 AA   420  PNTEXEC  LDA EXCBUF+1
A6A0 85 41      421           STA FILEBUF+1
A6A2 AD B4 AA   422           LDA EXCBUF
A6A5 85 40      423           STA FILEBUF
A6A7 60         424           RTS 
A6A8            425  ;
A6A8            426  ;
A6A8            427  ; File Manager driver routine
A6A8            428  ;
A6A8 20 06 AB   429  FMDRVR   JSR FMGR
A6AB 90 16      430           BCC RTS10
A6AD AD C5 B5   431           LDA RTNCODE
A6B0 C9 05      432           CMP #5
A6B2 F0 03      433           BEQ >9
A6B4 4C 5E B6   434           JMP APNDPTCH
A6B7 4C 92 B6   435  ^9       JMP APTCH3

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


A6BA EA         436           NOP 
A6BB EA         437           NOP 
A6BC EA         438           NOP 
A6BD EA         439           NOP 
A6BE A2 00      440           LDX #0
A6C0 8E C3 B5   441           STX DATARANG
A6C3 60         442  RTS10    RTS 
A6C4            443  ;
A6C4            444  ;
A6C4            445  ; Misc error messages
A6C4            446  ;
A6C4            447  ;
A6C4            448  ; SYNTAX ERROR
A6C4            449  ;
A6C4 A9 0B      450  CSYNERR  LDA #$B
A6C6 D0 0A      451           BNE DOERROR
A6C8            452  ;
A6C8            453  ;
A6C8            454  ; NO BUFFERS AVAILABLE
A6C8            455  ;
A6C8 A9 0C      456  NOBUF    LDA #$C
A6CA D0 06      457           BNE DOERROR
A6CC            458  ;
A6CC            459  ;
A6CC            460  ; PROGRAM TOO LARGE
A6CC            461  ;
A6CC A9 0E      462  PTOOBIG  LDA #$E
A6CE D0 02      463           BNE DOERROR
A6D0            464  ;
A6D0            465  ;
A6D0            466  ; FILE TYPE MISMATCH
A6D0            467  ;
A6D0 A9 0D      468  FMISMTCH LDA #$D
A6D2            469  ;
A6D2            470  ;
A6D2            471  ; GENERAL PRINT ERROR ROUTINE
A6D2            472  ;
A6D2 8D 5C AA   473  DOERROR  STA ASAVE
A6D5 20 E6 BF   474           JSR SETWARM
A6D8 AD B6 AA   475           LDA WHCBASIC
A6DB F0 04      476           BEQ >1
A6DD            477  ;
A6DD            478  ; If running under Applesoft,
A6DD            479  ; check the ONERR flag before
A6DD            480  ; printing a nasty error
A6DD            481  ; message.
A6DD            482  ;
A6DD A5 D8      483           LDA ASONERR
A6DF 30 0E      484           BMI >2
A6E1            485  ;
A6E1            486  ; If integer BASIC, or A/S w/o
A6E1            487  ; the ONERR condition, print
A6E1            488  ; an error message.
A6E1            489  ;
A6E1 A2 00      490  ^1       LDX #0
A6E3 20 02 A7   491           JSR PRTERROR
A6E6 AE 5C AA   492           LDX ASAVE
A6E9 20 02 A7   493           JSR PRTERROR

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


A6EC 20 C8 9F   494           JSR CRLF
A6EF            495  ;
A6EF            496  ; Reset BASIC pointers (just in
A6EF            497  ; case), if BASIC is running jump
A6EF            498  ; the the error handler.
A6EF            499  ;
A6EF            500  ;  If BASIC has stopped running do
A6EF            501  ; a warmstart.
A6EF            502  ;
A6EF 20 51 A8   503  ^2       JSR INITPTRS
A6F2 20 5E A6   504           JSR ISBASRUN
A6F5 AE 5C AA   505           LDX ASAVE
A6F8 A9 03      506           LDA #3
A6FA B0 03      507           BCS >3
A6FC 6C 5A 9D   508           JMP (BASERR)
A6FF 6C 5E 9D   509  ^3       JMP (BASWARM)
A702            510  ;
A702            511  ; Print the error message
A702            512  ; specifed by the X-register.
A702            513  ;
A702            514  ;
A702 BD 3F AA   515  PRTERROR LDA EMSGOFFS,X
A705 AA         516           TAX 
A706 8E 63 AA   517  ^4       STX TEMP1
A709 BD 71 A9   518           LDA ERRMSGS,X
A70C 48         519           PHA 
A70D 09 80      520           ORA #$80
A70F 20 C5 9F   521           JSR COUT
A712 AE 63 AA   522           LDX TEMP1
A715 E8         523           INX 
A716 68         524           PLA 
A717 10 ED      525           BPL <4
A719 60         526           RTS 
A71A            527  ;
A71A            528  ;
A71A            529  ; COPYPARM- COPY PARAMETERS TO
A71A            530  ; FILE MANAGER PARAMETER LIST
A71A            531  ;
A71A AD 66 AA   532  COPYPARM LDA VOLVAL
A71D 8D BF B5   533           STA VOLUME
A720 AD 68 AA   534           LDA DRVAL
A723 8D C0 B5   535           STA DRIVE
A726 AD 6A AA   536           LDA SLOTVAL
A729 8D C1 B5   537           STA SLOT
A72C AD 06 9D   538           LDA PFNADR
A72F 8D C3 B5   539           STA FNADR
A732 AD 07 9D   540           LDA PFNADR+1
A735 8D C4 B5   541           STA FNADR+1
A738 A5 40      542           LDA FILEBUF
A73A 8D 4F AA   543           STA BUFADR
A73D A5 41      544           LDA FILEBUF+1
A73F 8D 50 AA   545           STA BUFADR+1
A742 60         546           RTS 
A743            547  ;
A743            548  ;
A743            549  ; COPYFNAM- copies filename to
A743            550  ; file buffer
A743            551  ;

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


A743 A0 1D      552  COPYFNAM LDY #$1D
A745 B9 75 AA   553  ^5       LDA FNAME,Y
A748 91 40      554           STA (FILEBUF),Y
A74A 88         555           DEY 
A74B 10 F8      556           BPL <5
A74D 60         557           RTS 
A74E            558  ;
A74E            559  ;
A74E            560  ; COPYPTRS- copies FM workspace
A74E            561  ; to file buffer.
A74E            562  ;
A74E A0 1E      563  COPYPTRS LDY #$1E
A750 B1 40      564  ^6       LDA (FILEBUF),Y
A752 99 A9 B5   565           STA LB5A9,Y
A755 C8         566           INY 
A756 C0 26      567           CPY #$26
A758 D0 F6      568           BNE <6
A75A 60         569           RTS 
A75B            570  ;
A75B            571  ;
A75B            572  ; RSET0- reset to CSWSTATE 0, sets
A75B            573  ; the warmstart flag.
A75B            574  ;
A75B A0 00      575  RSET0    LDY #0
A75D 8C 51 AA   576           STY CURSTAT
A760 8C 52 AA   577           STY CSWSTATE
A763 60         578           RTS 
A764            579  ;
A764            580  ;
A764            581  ; LOCBUF- locates an available
A764            582  ; file buffer.
A764            583  ; Or it locates a file buffer
A764            584  ; that has the save filename
A764            585  ; as the file being opened.
A764            586  ;
A764            587  ;
A764 A9 00      588  LOCBUF   LDA #0
A766 85 45      589           STA OPRND+1
A768            590  ;
A768            591  ; go to the first file buffer
A768            592  ; and see if it is available.
A768            593  ;
A768 20 92 A7   594           JSR FRSTBUF
A76B 4C 73 A7   595           JMP CHKZERO
A76E            596  ;
A76E            597  ; Locate each successive buffer
A76E            598  ; in the chain and see if if
A76E            599  ; is available.
A76E            600  ;
A76E 20 9A A7   601  NXTBUF   JSR PNTNXTBF
A771 F0 1D      602           BEQ NOTINUSE
A773            603  ;
A773            604  ; If the buffer is in use, compare
A773            605  ; the filenames to see if they
A773            606  ; match.
A773            607  ;
A773 20 AA A7   608  CHKZERO  JSR GFBFNAM
A776 D0 0A      609           BNE >7

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


A778            610  ;
A778            611  ; If buffer is free, use this
A778            612  ; file buffer.
A778            613  ;
A778            614  ;
A778 A5 40      615           LDA FILEBUF
A77A 85 44      616           STA OPRND
A77C A5 41      617           LDA FILEBUF+1
A77E 85 45      618           STA OPRND+1
A780 D0 EC      619           BNE NXTBUF          ;always taken
A782            620  ;
A782            621  ;
A782            622  ; Compare file names
A782            623  ;
A782            624  ;
A782            625  ;
A782 A0 1D      626  ^7       LDY #$1D
A784 B1 40      627  ^8       LDA (FILEBUF),Y
A786 D9 75 AA   628           CMP FNAME,Y
A789 D0 E3      629           BNE NXTBUF
A78B 88         630           DEY 
A78C 10 F6      631           BPL <8
A78E 18         632           CLC 
A78F 60         633           RTS 
A790 38         634  NOTINUSE SEC 
A791 60         635           RTS 
A792            636  ;
A792            637  ;
A792            638  ; Point DBUFP at first buffer in
A792            639  ; chain.
A792            640  ;
A792 AD 00 9D   641  FRSTBUF  LDA DBUFP
A795 AE 01 9D   642           LDX DBUFP+1
A798 D0 0A      643           BNE >9
A79A            644  ;
A79A            645  ; Point DBUFP at next buffer in
A79A            646  ; the chain.
A79A            647  ;
A79A A0 25      648  PNTNXTBF LDY #$25
A79C B1 40      649           LDA (FILEBUF),Y
A79E F0 09      650           BEQ RTS7
A7A0 AA         651           TAX 
A7A1 88         652           DEY 
A7A2 B1 40      653           LDA (FILEBUF),Y
A7A4 86 41      654  ^9       STX FILEBUF+1
A7A6 85 40      655           STA FILEBUF
A7A8 8A         656           TXA 
A7A9 60         657  RTS7     RTS 
A7AA            658  ;
A7AA            659  ;
A7AA            660  ; GFBFNAM- gets first character of
A7AA            661  ; file buffers filename
A7AA            662  ;
A7AA A0 00      663  GFBFNAM  LDY #0
A7AC B1 40      664           LDA (FILEBUF),Y
A7AE 60         665           RTS 
A7AF            666  ;
A7AF            667  ;

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


A7AF            668  ; See if this buffer is being used
A7AF            669  ; by an EXEC command.
A7AF            670  ;
A7AF AD B3 AA   671  ISEXCBUF LDA EXFLG
A7B2 F0 0E      672           BEQ >0
A7B4 AD B4 AA   673           LDA EXCBUF
A7B7 C5 40      674           CMP FILEBUF
A7B9 D0 08      675           BNE RTS8
A7BB AD B5 AA   676           LDA EXCBUF+1
A7BE C5 41      677           CMP FILEBUF+1
A7C0 F0 01      678           BEQ RTS8
A7C2 CA         679  ^0       DEX 
A7C3 60         680  RTS8     RTS 
A7C4            681  ;
A7C4            682  ;
A7C4            683  ; Check the filetype;
A7C4            684  ;
A7C4 4D C2 B5   685  CHKTYPE  EOR FILETYPE
A7C7 F0 0A      686           BEQ RTS9
A7C9 29 7F      687           AND #$7F
A7CB F0 06      688           BEQ RTS9
A7CD 20 EA A2   689           JSR DOCLOSE
A7D0 4C D0 A6   690           JMP FMISMTCH
A7D3 60         691  RTS9     RTS 
A7D4            692  ;
A7D4            693  ;
A7D4            694  ; INIT the file buffer chain
A7D4            695  ;
A7D4            696  ;
A7D4            697  ; Set up for first file buffer
A7D4            698  ;
A7D4 38         699  INITBUFS SEC 
A7D5 AD 00 9D   700           LDA DBUFP
A7D8 85 40      701           STA FILEBUF
A7DA AD 01 9D   702           LDA DBUFP+1
A7DD 85 41      703           STA FILEBUF+1
A7DF            704  ;
A7DF            705  ; set up counter for maximum
A7DF            706  ; number of buffers.
A7DF            707  ;
A7DF AD 57 AA   708           LDA MAXFILES
A7E2 8D 63 AA   709           STA TEMP1
A7E5            710  ;
A7E5            711  ; Begin by zeroing out the file
A7E5            712  ; name, marking it as freed.
A7E5            713  ;
A7E5 A0 00      714  FREENAME LDY #0
A7E7 98         715           TYA 
A7E8 91 40      716           STA (FILEBUF),Y
A7EA            717  ;
A7EA            718  ; Init pointer to file manager
A7EA            719  ; work area.
A7EA            720  ;
A7EA A0 1E      721           LDY #$1E
A7EC 38         722           SEC 
A7ED A5 40      723           LDA FILEBUF
A7EF E9 2D      724           SBC #$2D
A7F1 91 40      725           STA (FILEBUF),Y

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


A7F3 48         726           PHA 
A7F4 A5 41      727           LDA FILEBUF+1
A7F6 E9 00      728           SBC #0
A7F8 C8         729           INY 
A7F9 91 40      730           STA (FILEBUF),Y
A7FB            731  ;
A7FB            732  ; set up pointer to T/S list
A7FB            733  ; buffer area.
A7FB            734  ;
A7FB AA         735           TAX 
A7FC CA         736           DEX 
A7FD 68         737           PLA 
A7FE 48         738           PHA 
A7FF C8         739           INY 
A800 91 40      740           STA (FILEBUF),Y
A802 8A         741           TXA 
A803 C8         742           INY 
A804 91 40      743           STA (FILEBUF),Y
A806            744  ;
A806            745  ; set up pointer to data buffer
A806            746  ; area.
A806            747  ;
A806 AA         748           TAX 
A807 CA         749           DEX 
A808 68         750           PLA 
A809 48         751           PHA 
A80A C8         752           INY 
A80B 91 40      753           STA (FILEBUF),Y
A80D C8         754           INY 
A80E 8A         755           TXA 
A80F 91 40      756           STA (FILEBUF),Y
A811            757  ;
A811            758  ; If this isn't the last file
A811            759  ; buffer, set up pointer to
A811            760  ; the next buffer
A811            761  ;
A811            762  ;
A811 CE 63 AA   763           DEC TEMP1
A814 F0 17      764           BEQ SETLINK0
A816 AA         765           TAX 
A817 68         766           PLA 
A818 38         767           SEC 
A819 E9 26      768           SBC #$26
A81B C8         769           INY 
A81C 91 40      770           STA (FILEBUF),Y
A81E 48         771           PHA 
A81F 8A         772           TXA 
A820 E9 00      773           SBC #0
A822 C8         774           INY 
A823 91 40      775           STA (FILEBUF),Y
A825 85 41      776           STA FILEBUF+1
A827 68         777           PLA 
A828 85 40      778           STA FILEBUF
A82A 4C E5 A7   779           JMP FREENAME
A82D            780  ;
A82D            781  ;
A82D            782  ; If at last file buffer, zero
A82D            783  ; out the pointer to the next

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


A82D            784  ; buffer and return
A82D            785  ;
A82D 48         786  SETLINK0 PHA 
A82E A9 00      787           LDA #0
A830 C8         788           INY 
A831 91 40      789           STA (FILEBUF),Y
A833 C8         790           INY 
A834 91 40      791           STA (FILEBUF),Y
A836            792  ;
A836            793  ; Set up HIMEM for the current
A836            794  ; BASIC.
A836            795  ;
A836 AD B6 AA   796           LDA WHCBASIC
A839 F0 0B      797           BEQ >1
A83B            798  ;
A83B            799  ; Set up HIMEM for A/S
A83B            800  ;
A83B 68         801           PLA 
A83C 85 74      802           STA ASHIMEM+1
A83E 85 70      803           STA ASSTRS+1
A840 68         804           PLA 
A841 85 73      805           STA ASHIMEM
A843 85 6F      806           STA ASSTRS
A845 60         807           RTS 
A846            808  ;
A846            809  ;
A846            810  ; Set up HIMEM for integer.
A846            811  ;
A846 68         812  ^1       PLA 
A847 85 4D      813           STA INTHIMEM+1
A849 85 CB      814           STA INTSTRT+1
A84B 68         815           PLA 
A84C 85 4C      816           STA INTHIMEM
A84E 85 CA      817           STA INTSTRT
A850 60         818           RTS 
A851            819  ;
A851            820  ;
A851            821  ; INITPTRS is called to restore
A851            822  ; DOS' control over the KSW
A851            823  ; and CSW hooks at locations
A851            824  ; $36 and $38.
A851            825  ;
A851 A5 39      826  INITPTRS LDA KSW+1
A853 CD 03 9D   827           CMP DOSKBD+1
A856 F0 12      828           BEQ >2
A858 8D 56 AA   829           STA KSWL+1
A85B A5 38      830           LDA KSW
A85D 8D 55 AA   831           STA KSWL
A860 AD 02 9D   832           LDA DOSKBD
A863 85 38      833           STA KSW
A865 AD 03 9D   834           LDA DOSKBD+1
A868 85 39      835           STA KSW+1
A86A A5 37      836  ^2       LDA CSW+1
A86C CD 05 9D   837           CMP DOSVID+1
A86F F0 12      838           BEQ RTS11
A871 8D 54 AA   839           STA CSWL+1
A874 A5 36      840           LDA CSW
A876 8D 53 AA   841           STA CSWL

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


A879 AD 04 9D   842           LDA DOSVID
A87C 85 36      843           STA CSW
A87E AD 05 9D   844           LDA DOSVID+1
A881 85 37      845           STA CSW+1
A883 60         846  RTS11    RTS 
A884            847  ;
A884            848  ;
A884            849  ;
A884 49 4E 49   850  DOSCMDS  DCI 'INIT'
A887 D4 
A888 4C 4F 41   851           DCI 'LOAD'
A88B C4 
A88C 53 41 56   852           DCI 'SAVE'
A88F C5 
A890 52 55 CE   853           DCI 'RUN'
A893 43 48 41   854           DCI 'CHAIN'
A896 49 CE 
A898 44 45 4C   855           DCI 'DELETE'
A89B 45 54 C5 
A89E 4C 4F 43   856           DCI 'LOCK'
A8A1 CB 
A8A2 55 4E 4C   857           DCI 'UNLOCK'
A8A5 4F 43 CB 
A8A8 43 4C 4F   858           DCI 'CLOSE'
A8AB 53 C5 
A8AD 52 45 41   859           DCI 'READ'
A8B0 C4 
A8B1 45 58 45   860           DCI 'EXEC'
A8B4 C3 
A8B5 57 52 49   861           DCI 'WRITE'
A8B8 54 C5 
A8BA 50 4F 53   862           DCI 'POSITION'
A8BD 49 54 49 
A8C0 4F CE 
A8C2 4F 50 45   863           DCI 'OPEN'
A8C5 CE 
A8C6 41 50 50   864           DCI 'APPEND'
A8C9 45 4E C4 
A8CC 52 45 4E   865           DCI 'RENAME'
A8CF 41 4D C5 
A8D2 43 41 54   866           DCI 'CATALOG'
A8D5 41 4C 4F 
A8D8 C7 
A8D9 4D 4F CE   867           DCI 'MON'
A8DC 4E 4F 4D   868           DCI 'NOMON'
A8DF 4F CE 
A8E1 50 52 A3   869           DCI 'PR#'
A8E4 49 4E A3   870           DCI 'IN#'
A8E7 4D 41 58   871           DCI 'MAXFILES'
A8EA 46 49 4C 
A8ED 45 D3 
A8EF 46 D0      872           DCI 'FP'
A8F1 49 4E D4   873           DCI 'INT'
A8F4 42 53 41   874           DCI 'BSAVE'
A8F7 56 C5 
A8F9 42 4C 4F   875           DCI 'BLOAD'
A8FC 41 C4 
A8FE 42 52 55   876           DCI 'BRUN'
A901 CE 

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


A902 56 45 52   877           DCI 'VERIFY'
A905 49 46 D9 
A908 00         878           HEX 00
A909            879  ;
A909            880  ;
A909            881  ;
A909            882  ;
A909 21         883  KWRDPRMS HEX 21
A90A 70 A0 70   884           HEX 70A070A170A070207020702070207060
A90D A1 70 A0 
A910 70 20 70 
A913 20 70 20 
A916 70 20 70 
A919 60 
A91A 00 22 06   885           HEX 00220620742206220423782270307040
A91D 20 74 22 
A920 06 22 04 
A923 23 78 22 
A926 70 30 70 
A929 40 
A92A 70 40 80   886           HEX 70408040800800080004004070400021
A92D 40 80 08 
A930 00 08 00 
A933 04 00 40 
A936 70 40 00 
A939 21 
A93A 79 20 71   887           HEX 792071207120
A93D 20 71 20 
A940 70         888           HEX 70
A941            889  ;
A941            890  ;
A941            891  ;
A941 D6 C4 D3   892  PPARMS   ASC "VDSLRBACIO"
A944 CC D2 C2 
A947 C1 C3 C9 
A94A CF 
A94B 40 20 10   893  PARMBITS HEX 40201008040201C0A090
A94E 08 04 02 
A951 01 C0 A0 
A954 90 
A955 00 00      894  KWRANGE  HEX 0000
A957 FE         895           HEX FE
A958 00 01 00   896           HEX 0001000200010007000100FF7F0000FF
A95B 02 00 01 
A95E 00 07 00 
A961 01 00 FF 
A964 7F 00 00 
A967 FF 
A968 7F 00 00   897           HEX 7F0000FF7F0000FFFF
A96B FF 7F 00 
A96E 00 FF FF 
A971            898  ;
A971            899  ;
A971 0D 07 8D   900  ERRMSGS  HEX 0D078D
A974 4C 41 4E   901           DCI 'LANGUAGE NOT AVAILABLE'
A977 47 55 41 
A97A 47 45 20 
A97D 4E 4F 54 

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


A980 20 41 56 
A983 41 49 4C 
A986 41 42 4C 
A989 C5 
A98A 52 41 4E   902           DCI 'RANGE ERROR'
A98D 47 45 20 
A990 45 52 52 
A993 4F D2 
A995 57 52 49   903           DCI 'WRITE PROTECTED'
A998 54 45 20 
A99B 50 52 4F 
A99E 54 45 43 
A9A1 54 45 C4 
A9A4 45 4E 44   904           DCI 'END OF DATA'
A9A7 20 4F 46 
A9AA 20 44 41 
A9AD 54 C1 
A9AF 46 49 4C   905           DCI 'FILE NOT FOUND'
A9B2 45 20 4E 
A9B5 4F 54 20 
A9B8 46 4F 55 
A9BB 4E C4 
A9BD 56 4F 4C   906           DCI 'VOLUME MISMATCH'
A9C0 55 4D 45 
A9C3 20 4D 49 
A9C6 53 4D 41 
A9C9 54 43 C8 
A9CC 49 2F 4F   907           DCI 'I/O ERROR'
A9CF 20 45 52 
A9D2 52 4F D2 
A9D5 44 49 53   908           DCI 'DISK FULL'
A9D8 4B 20 46 
A9DB 55 4C CC 
A9DE 46 49 4C   909           DCI 'FILE LOCKED'
A9E1 45 20 4C 
A9E4 4F 43 4B 
A9E7 45 C4 
A9E9 53 59 4E   910           DCI 'SYNTAX ERROR'
A9EC 54 41 58 
A9EF 20 45 52 
A9F2 52 4F D2 
A9F5 4E 4F 20   911           DCI 'NO BUFFERS AVAILABLE'
A9F8 42 55 46 
A9FB 46 45 52 
A9FE 53 20 41 
AA01 56 41 49 
AA04 4C 41 42 
AA07 4C C5 
AA09 46 49 4C   912           DCI 'FILE TYPE MISMATCH'
AA0C 45 20 54 
AA0F 59 50 45 
AA12 20 4D 49 
AA15 53 4D 41 
AA18 54 43 C8 
AA1B 50 52 4F   913           DCI 'PROGRAM TOO LARGE'
AA1E 47 52 41 
AA21 4D 20 54 
AA24 4F 4F 20 

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


AA27 4C 41 52 
AA2A 47 C5 
AA2C 4E 4F 54   914           DCI 'NOT DIRECT COMMAND'
AA2F 20 44 49 
AA32 52 45 43 
AA35 54 20 43 
AA38 4F 4D 4D 
AA3B 41 4E C4 
AA3E 8D         915           HEX 8D
AA3F            916  ;
AA3F            917  ;
AA3F            918  ;
AA3F 00 03 19   919  EMSGOFFS HEX 0003191924333E4C5B646D788498AABB
AA42 19 24 33 
AA45 3E 4C 5B 
AA48 64 6D 78 
AA4B 84 98 AA 
AA4E BB 
AA4F            920  ;
AA4F            921  ;
AA4F            922  ; 
AA4F            923  ; VARIABLES 
AA4F            924  ;
AA4F            925  ;
AA4F            926  BUFADR   DFS 2
AA51            927  CURSTAT  DFS 1
AA52            928  CSWSTATE DFS 1
AA53            929  CSWL     DFS 2
AA55            930  KSWL     DFS 2
AA57            931  MAXFILES DFS 2
AA59            932  SSAVE    DFS 1
AA5A            933  XSAVE    DFS 1
AA5B            934  YSAVE    DFS 1
AA5C            935  ASAVE    DFS 1
AA5D            936  CMDLNIDX DFS 1
AA5E            937  MONFLGS  DFS 1
AA5F            938  CMDINDX  DFS 1
AA60            939  LOADLEN  DFS 2
AA62            940  PENDCMD  DFS 1
AA63            941  TEMP1    DFS 1
AA64            942  KYWRDIDX DFS 1
AA65            943  KYWRDFND DFS 1
AA66            944  VOLVAL   DFS 2
AA68            945  DRVAL    DFS 2
AA6A            946  SLOTVAL  DFS 2
AA6C            947  LENVAL   DFS 2
AA6E            948  RECVAL   DFS 2
AA70            949  BYTVAL   DFS 2
AA72            950  ADRVAL   DFS 2
AA74            951  MONVAL   DFS 1
AA75            952  FNAME    DFS 30
AA93            953  SFNAME   DFS 30
AAB1 03         954  MXFLS    HEX 03
AAB2 84         955  CTLD     HEX 84
AAB3            956  EXFLG    DFS 1
AAB4            957  EXCBUF   DFS 2
AAB6            958  WHCBASIC DFS 1

LISA 2.5                  DOS 3.3 CMD INTERPRETER            


AAB7            959  RUNINTRC DFS 1
AAB8 C1 D0 D0   960  LAAB7    ASC "APPLESOFT"
AABB CC C5 D3 
AABE CF C6 D4 
AAC1            961  ;
AAC1            962  ;
AAC1            963  ; The following are overlapping
AAC1            964  ; with the equivalent defs in
AAC1            965  ; the FILE.MNGR file.
AAC1            966  ;
AAC1 E8 B7      967  LAAC1    ADR $B7E8
AAC3 BB B3      968  LAAC3    ADR $B3BB
AAC5 BB B4      969  LAAC5    ADR $B4BB
AAC7 00 C0      970  LACC7    ADR $C000
AAC9            971           END 


***** END OF ASSEMBLY 

!